Author Archives: Marco Moioli

About Marco Moioli

My job role is Infrastructure Consultant. My job consist in study, architect and deploy solutions based on Microsoft products. My goal is to understand the customer environment and to find the best solution based on Microsoft technology that address the customer needs. I take part in pre sales activites as desktop deployment and datacenter technical specialist. I have had experience with large Microsoft customers like ENI, Saipem, Banca Carige, Banca Intesa, FIAT, Banca Popolare di Milano, Pirelli, Equitalia, Telecom Italia, Prysmian, Barilla, Banca Popolare di Verona e Novara, Il Sole 24 Ore, Wind, Maire Technimont, Ericsson, Vodafone, Comune di Milano, AGSM. I was leader of the Core IO Data Desktop and Server Management community @ Microsoft Italy.Community From December 2011 to September 2013. Actually I'm the owner of the Client Deployment Metric @ Microsoft Italy. Specialties: Active Directory Infrastructures, Management Solutions (SCCM, SCOM, SCVMM, SCDPM, WDS, MDT, MDOP, All System Center Products), Virtualization solutions (Hyper-V, SCVMM, APP-V, MED-V), OS Build Creation and Deployment, Private/Public/Hybrid Cloud Solutions based on Microsoft Technology

VMWare 5.x Vs Hyper-V TCO

Beware of this whitepaper!

VMWare compares Hyper-V 2008 R2 and System Center 2008 R2 versus vSphere 5.x.

The last Microsoft virtualization suite is the 2012 R2 (Hyper-V 2012 R2 and System Center 2012 R2)

It’s like comparing a brand new Yamaha R1 with a 5 years old Honda CBR 1000…

It’s not fair!




Windows 2012 R2 Virtual Machine Automatic Activation

With the last release of Windows Server, Microsoft introduced a new interesting feature: Virtual Machine Automatic Activation (VMAA).

This feature enables the Hypervisor to automatically activate VMs without the support of a KMS server.

Why Microsoft built this feature? Because if you are a Service Provider and you want to provide VMs as a service you need to create those machines already activated.

If the VM is connected only with the tenant/customer network, you need a KMS server in place on this network or you need a different smart way to activate your VM.

What you need to know is that:

  • The Hyper-V host needs to be a Windows 2012 R2 Datacenter Edition (VMAA doesn’t work on a R2 Standard edition or 2008/2012 edition or a third party Hypervisor)
  • The Hyper-V host needs to be activated
  • The automatically activated guests need to be Windows 2012 R2 (Standard, Datacenter or Essential Edition)
  • The VMs needs to have a specific product keys in order to succeed in using VMAA (see below)
  • If you want to move your autmatically activated VM from a Windows 2012 R2 Datacenter Edition to a different Windows Hypervisor (for example a Windows 2012 R2 Standard Edition) the VM will be deactivated in a week and you will need to use another method to re-activate it (KMS for example)

The specific product keys that you need to install in your guest VMs are Link:

  • Windows Server 2012 R2 Datacenter:           Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
  • Windows Server 2012 R2 Standard:               DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
  • Windows Server 2012 R2 Essentials:              K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

You can use an unattended file or System Center Virtual Machine templates in order to inject the new product key.

Building an Answer File: Link

Creating Virtual Machine Templates in System Center VMM: Link

Deploy UEFI and Legacy BIOS PC using a custom WinPE

My customer has implemented a custom procedure to build Windows 7/8 machines.

Instead of using MDT or SCCM he uses a custom portal that starts a custom WinPE full of custom code/script.

Now that we need to build Surface 2 Pro devices using the corporate image, we are facing the following challenges:

  • Use a x64 version of WinPE instead the x86 version (on a UEFI device like Surface you can run only x64 operating systems)
  • Find an automatic procedure to know if the bios is legacy or UEFI native
  • Modify the diskpart script in order to fit the different bios requirements

We used WinPE 5.0 x64 from the last Windows AIK Link. This WinPE can apply both x86 and x64 images and run on native UEFI BIOS machines like Surface 2 Pro as well than Legacy BIOS devices.

The second challenge was to find out a procedure to know if we are booting from a UEFI or Legacy BIOS device.

MDT implements a built-in logic to understand the BIOS type. It was not so easy to transport/translate this logic into my custom WinPE so I found two alternatives:

  • Add Powershell feature to WinPE and try the Get-SecureBootUEFI cmdlet Link
  • Use the GetFirmwareEnvironmentVariable function from a C++ program Link

I tried the first one but it seems that the WinPE Powershell feature is only a subset of cmdlet so I was not able to use the Get-SecureBootUEFI cmdlet.

The second one needs to build a .exe that implement the function but fortunately I found this Link

I was able to use the .exe file to discover if a system is booting from UEFI or Legacy BIOS. Link

The code written by Richard Mueller is very simple:

/* Compile this with cl.exe from MS SDK, e.g. ‘cl efidetect.cpp’, that is all. */
/* IBM(c) 2011 EPL license */

#include <windows.h>
#include <stdio.h>

int main(int argc, char* argv[])
return 1;
return 0;
return 0;

The last point was about change the diskpart behaviour.

If the .exe is returning “Legacy” I will call diskpart with a .txt file that create the classic partitions for Legacy BIOS systems.

If the .exe is returning “UEFI” I will call diskpart with a .txt file that create the correct partitions for UEFI BIOS devices. Link

Windows Server Hyper-V 2012 R2 Shared VHDX Feature

With Windows Server Hyper-V 2012 R2 you can share a virtual disk between virtual machines.

This is very useful in Clustering scenarios  and you can read more about this technology here:

I’d like to share this additional information rised during a q&a with collegues from product group:

Question: Using shared VHDX feature which are the implications for Live Migration? With Shared VHDX can you perform:

  1. Live Migration?
  2. Live Storage Migration?
  3. Shared Nothing Live Migration?

As a quick reminder, here are the different types of Live Migration and a brief description…

  1. Live Migration. In this scenario, the virtual machine running state is moved between compute nodes while the virtual machine storage stays in place.
  2. Live Storage Migration. In this scenario, the virtual machine running state stays on the same compute node while the virtual machine storage is migrated to a new location.
  3. Shared Nothing Live Migration. In this scenario, the virtual machine running state and the virtual machine storage is moved.

Answer:  Shared VHDX works with Live Migration however it doesn’t work with Shared Nothing Live Migration and Live Storage Migration because moving a virtual machine with Shared VHDX requires systematically coordinating configuration updates for the associated virtual machines across multiple hosts.

Hyper-V and Windows Power Management

Windows Power Management is a feature that works with CPUs that can dynamically adjust processor voltage and core frequency to decrease heat and power usage.
As you can see in Task Manager, while the Maximum Speed is 2.30 GHz, the actual speed is typically much lower ~1.0 GHz.

However, installing Hyper-V feature, it seems that the Processor Power Management doesn’t appear to work anymore


Processor power management is still running but when the hypervisor is enabled, it
is in charge of managing processors, including processor power
management.  Therefore, you won’t see Processor Power Management activity
when looking at Task Manager or the root’s (parent) performance counters. You
have to look at the hypervisor logical processor counter sets to see C-states,

Take a look at this article about Hyper-V Logical Processor Counters.

Unknown devices in Windows 2012 R2 Virtual Machines

If you are using Windows 2012 R2 hypervisor and you want to create a VM using one of the following OS:

  • Windows 2003
  • Windows 2008
  • Windows 2008 R2
  • Windows 2012
  • Windows XP
  • Windows 7
  • Windows 8

You will notice that in the device manager two devices are in an unknown state.

Unknown State

This is expected because the two missing devices are related to two Hyper-V 2012 R2 features supported only by Windows 2012 R2 Virtual Machines.

The two new features are:


Automatic activation

This is a new feature in Windows Server 2012 R2 that makes it easier to use the licensing advantages accorded by Windows Server Datacenter. Windows Server Datacenter provides unlimited virtual machine instances of Windows Server for a licensed system. With automatic activation, Windows Server 2012 R2 guests will automatically activate themselves when running on a Windows Server 2012 R2 Datacenter.


Enhanced Session Mode

In previous versions of Hyper-V, Virtual Machine Connection provided redirection of only the virtual machine screen, keyboard, and mouse with limited copy functionality. To get additional redirection abilities, a remote desktop connection to the virtual machine could be initiated, but this required a network path to the virtual machine.

Starting with Hyper-V in Windows Server 2012 R2, Hyper-V can now redirect local resources to a virtual machine session through Virtual Machine Connection tool. The enhanced session mode connection uses a Remote Desktop Connection session via the virtual machine bus (VMBus), so no network connection to the virtual machine is required.

I will write an in-depth article about these interesting features ASAP.

System Center Operations Manager – Manually remove dependencies from Management Packs

My friend Riccardo Corna wrote an interesting article about how to remove dependencies from Management Packs in Microsoft System Center Operations Manager.

The original article is written in italian so you can read it here:

If you are an English reader, you can read it using the (automatically) translated version: