Category Archives: Windows Server 2012

Hyper-V Compact VHD(X) Disk Task Taking Hours to Complete in GUI

The Scenario

I have a VM on my Windows Server 2012 R2 Standard with Hyper-V role. It has a dynamically expanding disk which I need to compact to reclaim disk space on the host.

The Problem

I used the Hyper-V Management console to compact the disk, but after several hours it’s still running. And because you can only compact a disk on a powered-off VM my business critical VM remains offline.

The Solution

In my case the compact process actually completed successfully within 30 minutes, it’s just the GUI had crashed even though it looked like it was still running normally (the green progress bar hadn’t quite reached the end). I found this out by look in the Event Logs:

Event Viewer > Applications and Services Logs > Microsoft > Windows > Hyper-V-VMMS > Operational log

Search for event ID 27301

“The system successfully compacted ‘:\Virtual Hard Disks\.vhdx’.”

Once I saw this I pressed cancel on the GUI compact window and restarted the Hyper-V management console. I was then able to successfully power-on my VM and the space had been successfully reclaimed.

I also noticed that the high disk activity that had been seen during the early stages of the disk compaction had completely stopped, however the above event log gave me the confidence to cancel the GUI.

NB To enable disk performance counter in Server 2012 R2 open an elevated command prompt and enter the following command “diskperf -y” then close/reopen the task manager window.

Disclaimer: provided “AS IS” with no warranties and confer no rights

WSUS Console Fails to Start: SQL server may not be running

The Scenario

I have WSUS installed on a Windows Server 2012 Standard instance. At the weekend I have installed various updates, including KB3159706.

The Problem

Once KB3159706 installed the WSUS console will not run despite both the WSUS Service and Windows Internal Database services running. It keeps reporting the error that the SQL server may not be running, which is not the case.

The Solution

The fault lies with update KB3159706, and there are two options

Solution 1 (Preferred):

Open an elevated command prompt and type

“C:\Program Files\Update Services\Tools\wsusutil.exe” postinstall /servicing


Wait 1-2 minutes for it to complete…


Enable HTTP Activation under .NET Framework 4.5 Features (I did this in PowerShell or use the Server Manager GUI)

Install-WindowsFeature AS-HTTP-Activation


Finally, restart the WSUS Service

get-service WsusService | Restart-Service

The WSUS console should now launch successfully.


Solution 2 (less secure):

You can simply uninstall this update from the Control Panel (Control Panel > All Control Panel Items > Programs and Features > Installed Updates and search for this update, right-click and select uninstall).


Disclaimer: provided “AS IS” with no warranties and confer no rights

Hyper-V VM not recognising F8 Safe Boot Mode Keystroke

The Scenario

I have a Windows Server Vm running in Hyper-V. I have a problem with the OS and need to boot into Safe Mode by pressing F8 at boot time.

The Problem

The VM is not responding to the F8 keystroke, even if i start pressing it repeatedly, even over-zealously (mimicking days of yore when I played Daley Thompson’s Decathlon on the ZX Spectrum) as soon as the VM starts. The Safe Mode menu fails to materialise, instead it just boots as normal.

The Solution

Change the VM Automatic Start Action settings by changing the Automatic start delay time from 0 to 5 seconds (or any number great than 3 seems to work). Click OK to Confirm.


Now when you restart the VM and press F8 the menu will appear:



Task Scheduler jobs now failing with error 0x1

The Scenario

I have Windows Server 2012 R2 Standard installation. I have a requirement for PowerShell scripts to be run automatically, for this I use the Windows Task Scheduler to launch the powershell.exe program.


The Problem

Recently my scheduled tasks have been failing with a last run result error 0x1, and very little other details.

The Solution

Task Scheduler no longer seems to recognise what “powershell.exe” is or what application to launch, hence why the jobs are failing.

To resolve the problem in the program/script field replace “powershell.exe” with the full path name “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe” and click OK.


In my scenario no other change was required.

Disclaimer: provided “AS IS” with no warranties and confer no rights

Run as different user, plus elevated

The Scenario

I have a user Joey Bloggs, who  has recently been migrated to a new domain DOMAINB.TEST. He’s currently logged on to a client in the DOMAINB.TEST domain. However he needs to run a powershell script against servers still residing in DOMAINA.TEST using his old DOMAINA credentials. NB there is a two-way trust between the domains.  However he also needs to run the script within an elevated Powershell ISE window.

The problem

Windows only provides the option to run as administrator OR a different user. I need to do both.


The Solution

On the DOMAINB.TEST client Joey Bloggs opens an elevated command prompt and enters:

runas /netonly /user:jbloggs@domaina.test PowerShell_ISE.exe

He’s them prompted to enter his DOMAINA.TEST credentials. The ISE sessions opens elevated and running as jbloggs@domaina.test.


Of course this would work just as well in the same domain. In this scenario Bill is logged in and for some reason needs to run a cmdlet or script as Joey Bloggs and within an elevated session. Bill would complete the following steps:

  1. Open an elevated command prompt
  2. Run runas /netonly /user:jbloggs@domaina.test PowerShell_ISE.exe
  3. Enter Joey’s credentials.


Disclaimer: provided “AS IS” with no warranties and confer no rights

Cannot connect to Hyper-V host via Windows 8 Client and Hyper-V Manager

The Scenario

I have domain Windows 8.1 client with Hyper-V manager installed. There is also a Hyper-V host (Windows Server 2012 R2 with Hyper-V role). The client needs to connect to the Hyper-V host via the Hyper-V Manager. The user logged on to the client is a member of the Hyper-V Administrators group on the host.

The Problem

The connection attempt fails with the following error:


The Solution

On the host open an elevated command prompt and run:

MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof


No reboot is required, the fix is immediate.

Disclaimer: provided “AS IS” with no warranties and confer no rights

ADMT: ERR2:7674 Unable to determine the local path for ADMIN share

The Scenario

I am attempting to migrate a server from one domain to another using the Microsoft ADMT (Active Directory Migration Tool). The ADMT is running as a Domain Admin account on the destination domain.

The Problem

ADMT reports the following error when attempting to run the pre-check

“ERR2:7674 Unable to determine the local path for ADMIN share on the machine ‘<server_fqdn>’.  rc=-2147024891”

The Pre-check fails and the migration tasks stops.

The Solution

Add the user account you’re logged in to the ADMT server (and running the migration task) as to the local admin group of the server you are trying to migrate. ADMT will detect the change within 1-2 minutes.

Server 2012: Stuck at “Updating your System 8%”

The Scenario:

One of my Windows Server 2012 R2 Standard servers installed a large number of updates +200 all at once (so unfortunately I’ve no idea which one caused this problem).

The Problem:

After the reboot the server was stuck on the start-up splash screen stating “Updating your system 8%”. I tried the following

  • Waiting several hours
  • Rebooting
  • Rebooting in Safe Mode (press F8 immediately as the server boots to access this boot option)
  • Rebooting using Last Known Good Configuration (press F8 immediately as the server boots to access this boot option)

None of the above worked.

The Solution:

  1. Reboot the server, press F8 to access advanced boot options. NB If your server is a Hyper-V VM you may be having problems getting the F8 prompt to work, if so see this link for details on how to resolve this.
  2. Select the Option “Repair Your Computer”
  3. 8_per_1
  4. In the Options screen select Troubleshoot > Command Prompt > Click Administrator user
  5. 8_per_2
  6. 8_per_3
  7. 8_per_4
  8. Enter the Local Administrator password.
  9. 8_per_5
  10. 8_per_6
  11. The server boots into a limited command prompt at the X drive:
  12. 8_per_7
  13. Get a list of all the available drives, type “wmic logicaldisk get name“. This is important as whilst in the repair environment the drive mappings often get changed around i.e. I was panicking when I changed to the C drive only to find it was empty. In fact the system drive was mapped to the D drive. There’s no obvious way to tell, you just have to change to each drive mapping a run a Dir command.
  14. 8_per_8
  15. Navigate to the \Windows\Winsxs folder. Once here you need to find all the files called pending.xml* and rename them all by adding .OLD to the end of the file name. (In my server I had two pending.xml and pending.xml.random_number – I added .OLD to the end of both of these). The reason for this is it’s in one of these there is a corruption that’s the cause of the problem.
  16. 8_per_9
  17. Create a new blank pending.xml file in the \Windows\Winsxs folder; echo > pending.xml
  18. Create a scratch folder in the \Windows directory; mkdir D:\windows\scratch (This is a requirement for step 19, otherwise you will get a 3017 error, which complains the default temporary location for the scratch folder is too small.)
  19. Next up is to run a DISM command to remove/revert all pending actions from the image, in our case these updates attempting to install. Run the following command (NB my system drive was mapped to the D drive);    DISM /Image:D:\ /Cleanup-Image /RevertPendingActions /scratchdir:D:\Windows\Scratch
  20. Once step 19 is complete rename the \windows\SoftwareDistribution to SoftwareDistributionOLD:
  21. ren D:\windows\SoftwareDistribution SoftwareDistributionOLD
  22. Finally, run sfc /scannow – the System File Checker tool to repair missing or corrupted system files
  23. Reboot the server. The start-up splash screen should show spinning dots for a minute or two then boot normally. In my instance it then reported updates couldn’t be installed and so reverted those that had been installed. It then forced another reboot.
  24. At this stage the server is ready to have updates installed, but this time only do a few at a time to locate the faulty update.

Disclaimer: provided “AS IS” with no warranties and confer no rights

Windows 2012 NFS Versions

The Scenario:

I am trying to mount an NFS share from my Server 2012 File server onto a Linux client, but to do so I need to know what versions of NFS Windows supports

The Problem:

Nowhere in the properties of the NFS share is there a mention of the supported NFS versions.


The Solution:

The NFS versions are visible via the Server Manager. Highlight the top-level servers list, right-click the File server serving the NFS share and select NFS Settings


The first tab of the NFS settings shows the NFS versions available (these can be selected/deselected as required)


Disclaimer: provided “AS IS” with no warranties and confer no rights

NetApp CIFS shares not mounting to Windows Server 2012

The Scenario:

I have created a NetApp CIFS share that needs to be accessible on Server 2003, 2008R2 and 2012R2 servers.

The Problem:

The NetApp CIFS share connects fine on a Windows Server 2003 or 2008 machine, but when I tried on a Server 2012 R2 it wouldn’t connect and I’d get the following error:


The Solution:

The NetApp Filer had digital signing set to off, whereas Windows Server 2012 requires it by default. This mismatch causes the share failure. I was unable to enable digital signing on the NetApp due to the potential performance degradation it would have caused so the other option was to disable the digital signing requirement on Windows.

In an elevated PowerShell terminal type:

Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters” RequireSecureNegotiate -Value 0 -Force

No reboot is required.

Disclaimer: provided “AS IS” with no warranties and confer no rights