The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,346 other followers

Archive for the ‘Windows 7’ Category

Finding out when your domain password will expire :: Active Directory :: Admin Tips :: Windows 7 :: Windows Server 2012/2008/2003/2000/XP/NT Administrator Knowledge Base :: KBase Tips :: WindowsNetworking.com

Posted by jpluimers on 2018/02/02

Here’s how you can find out when your domain password will expire.

net user %USERNAME% /domain

It figures this out for the current logon domain (so it doesn’t work cross-domain) but it is a great help, especially when filtering out just the password information:

net user %USERNAME% /domain | findstr "Password"

This can be done in a more complex way with dsquery or adinfo that are tools to query

Read the rest of this entry »

Posted in Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Vista, Windows XP | Leave a Comment »

Microsoft guided walk through to Fix Windows Update errors

Posted by jpluimers on 2018/01/19

This one helped me to fix a 0x80243004 error: somehow the virtual network adapter didn’t work well and a reboot worked.

Use our guided walk through to help you resolve Windows Update issues using the error code you got while updating your version of Windows.

Source: Fix Windows Update errors

–jeroen

Posted in Power User, Windows, Windows 7 | Leave a Comment »

Provisioning Windows 7 test VMs with know users/passwords

Posted by jpluimers on 2018/01/16

The proxmox side

In Proxmox, ensure you have a named backup of your machine that starts with vzdump-qemu like this:

vzdump-qemu-Win7Sp1UK.vma.lzo

That way, Proxmox knows that it can restore from it.

Don’t forget to assign a new MAC address to the network adapter so it’s unique on the network.

The Windows side

I wanted to provision this with two test accounts: one regular and one with administrator access.

The latter needs to be added to the Administrators group using [WayBacknet localgroup.

Both need passwords that (for now) never expire. This is where [WayBacknet user add fails: even if you set the correct flag, it won’t be reflected, so you need WMIC UserAccount for that.

These two posts helped me a lot with the below batch file fragment:

After restoring, run a batch file like this with an UAC token:

  call :addUser regularTestUser regularTestPassword
  net localgroup "Remote Desktop Users" "regularTestUser" /add
  call :addUser administratorTestUser administratorTestPassword
  :: https://superuser.com/questions/515175/create-admin-user-from-command-line
  net localgroup administrators administratorTestUser /add
  goto :eof
:addUser
  :: https://superuser.com/questions/515175/create-admin-user-from-command-line
  net user /expires:never /add %1 %2 /expires:never
  :: https://serverfault.com/questions/710964/accounts-suddenly-expiring-when-created-with-net-user-add-expiresnever
  WMIC UserAccount where "Name='%1'" set PasswordExpires=FALSE
  goto :eof

The Remote Desktop Users tip is from [WayBackEnable remote desktop from command line (CMD) but that post has “beautified” double quotes in them, so net localgroup by default complains it cannot find the group. The code above should have regular quotes.

Finally the computer needs a new name. Again WMIC to the rescue here as Windows 7 only comes with PowerShell 2.0 which cannot rename a computer.

Again with a UAC token, execute something like this:

WMIC ComputerSystem where Name="%COMPUTERNAME%" call Rename Name=INNOSETUPTEST
%windir%\System32\shutdown.exe -r

This last tip was via [WayBackwindows 7 – Renaming computers via command prompt – Super User.

–jeroen

Posted in Power User, Proxmox, Virtualization, Windows, Windows 7 | Leave a Comment »

Proxmox – recovering a Windows 7 machine having “Missing operating system”

Posted by jpluimers on 2018/01/12

This is not what you like when you reboot a VM in Proxmox:

Booting from Hard disk...
Missing operating system

Booting from Hard disk... Missing operating system

Booting from Hard disk… Missing operating system

This case was a Windows 7 UK Professional x64 SP1 virtual machine.

Luckily the ISO is at https://archive.org/download/en_windows_7_professional_with_sp1_x64_dvd_u_676939_201606/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso via https://archive.org/details/en_windows_7_professional_with_sp1_x64_dvd_u_676939_201606 (later I found out I had the image in my backup vault as well).

I put that one in /var/lib/vz/template/iso so proxmox will automagically provide it in the local storage of iso images.

Now for some screenshots some based on what I learned at [Archive.isHow to use System Recovery Options for repairing Windows Vista or 7 installations:

Read the rest of this entry »

Posted in Power User, Proxmox, Virtualization, Windows, Windows 7 | Leave a Comment »

Consolidating NTFS free space

Posted by jpluimers on 2017/12/29

For shrinking VM disk images, it’s important to consolidate NTFS free space towards the end of the this.

I’ve tried many tools, starting with defrag C: /X (which tries, but doesn’t give good results) and found out these steps give the best results:

  1. Perform an Ultradefrag full optimisation,
  2. Perform a MyDefrag Consolidate free space script on the drive.

If shrinking still fails then:

  1. Try the Ultradefrag at boot time
  2. Verify what kind of file(s) prevent shrinking: they show up in red after the MyDefrag session:
    1. Zoom in them (they can initially as small as 1 red pixel) by clicking on or near them, repeating the zoom long enough so you can hover over with the mouse and the lower part of the screen shows a filename like  where you cannot find much information about “$badclus:$bad:$data” but appear to be clusters marked as bad on NTFS level using something like chkdsk /B.
    2. If it was a bad sector like above, then try to resolve it with [WayBackntfsfix which ships with GParted live boot:
      1. boot a [WayBackGParted — Live CD/USB/PXE/HD drive,
      2. run GParted to see the drive path (for instance /dev/sda1)
      3. start a terminal
      4. run this command:
        ntfsfix -b /dev/sda1
        which will give output like this:

        Mounting volume... OK
        Processing of $MFT and $MFTMirr completed successfully.
        Checking the alternate boot sector... OK
        NTFS volume version is 3.1.
        Going to un-mark the bad clusters ($BadClus)... OK
        NTFS partition /dev/sda1 was processed successfully.
      5. boot back into Windows
      6. on an administrative command prompt run this for the affected drive letter:
        chkdsk D: /B
        (reboot if needed)
  3. Shrink the drive using diskmgmt.msc

If you still cannot shrink, then try [WayBackhttp://ftp.raxco.com/pub/download/pd14.0/pd14.0_pro.exe PerfectDisk by Raxco free trial.

Note:

MyDefrag (formerly named JkDefrag) is not maintained any more but the 4.3.1 version in the WayBack machine still works very well as the underlying defragmentation APIs in Windows haven’t changed.

References:

For FAT32:

For GParted / ntfsfix:

PerfectDisk via:

–jeroen

Posted in Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Vista | Leave a Comment »

 
%d bloggers like this: