banner



How To Activate Windows Server 2012 R2 Standard Virtual Machine

Hi folks,

Automatic Virtual Automobile Activation! is pretty cool characteristic…

Automatic Virtual Automobile Activation (AVMA) is a feature that was introduced in Windows Server 2012 R2. AVMA binds the virtual auto activation to the licensed virtualization server and activates the virtual machine when it starts upwardly. This eliminates the demand to enter licensing information and actuate each virtual machine individually.

Requirements:
In guild to go benefits of this feature, AVMA requires that the host is running Windows Server 2012 R2 Datacenter and that the guest virtual auto OS is either Windows Server 2012 R2 Datacenter, Windows Server 2012 R2 Standard or Windows Server 2012 R2 Essentials.

How to:
This is a one step process. Once the Hyper-5 host (Windows Server 2012 R2 Datacenter) is activated and guest virtual machines are running smoothly (without activation of course!), the only remaining step is to install the AVMA client cardinal on the guest virtual machines (Data Center, Standard or Essentials). To manually install the key using Command line use the following Syntax from an administrative Command prompt inside the invitee Os:

C:\>slmgr.vbs /ipk AVMA Fundamental

Where the generic AVMA Key is selected according to the Guest Bone Edition, more than information hither .

Auto-AVMA01

Note:
The whole activation process does not require any network connectedness of whatsoever sort between the Hyper-V host and the guest OS.

This is how the manual approach to actuate Windows Server 2012 R2 VM.

Scenario:
You have deployed several virtual machines from a template without SCVMM or deployment tool such as MDT where you can inject above process during the deployment, and now you want to activate all VMs.

Of course you could use the transmission approach above, but the easiest manner is to utilize PowerShell, I accept created a small script that takes care of all the steps for you:

Here we go:

First nosotros need to check what is the License Status of all Virtual Machines? you tin run the following cmdlet to go all VMs on a single host:

# Turn On Offline Virtual Machines Become-VM | ?{$_.State -eq "Off"} | Offset-VM # Check Virtual Machines License Condition: UNLICENSED  $cim = New-CimSession -ComputerName (Go-VM).name  get-ciminstance -grade SoftwareLicensingProduct -CimSession $cim |  where {$_.proper name -friction match 'windows' -and $_.licensefamily} |  format-list -property Proper noun, Description, `  @{Label= "License Status"; Expression={switch (foreach {$_.LicenseStatus}) `  { 0 {"Unlicensed"} `  ane {"Licensed"} `  ii {"Out-Of-Box Grace Period"} `  3 {"Out-Of-Tolerance Grace Period"} `  4 {"Non-18-carat Grace Period"} `  } } }


Auto-AVMA02

We plant out that all virtual machines are not activated even so!

So allow's activate them automatically using PowerShell combined with Hyper-5 Guest Services feature Winking smile

# Create AVMA file including Windows Server 2012 R2 Standard Generic Key # NOTE! Choose the proper generic cardinal according to the Guest Os Edition # https://technet.microsoft.com/en-us/library/dn303421.aspx New-Item -Path "C:\AVMA.cmd" -Type file Add-Content C:\AVMA.cmd "cscript //B %windir%/system32/slmgr.vbs /ipk DBGBW-NPF86-BJVTX-K3WKJ-MTB6V"  # Define variables  $AVMAFilePath = "C:\AVMA.cmd"  # Get all VMs on a unmarried Host  $VMNames = Get-VM  # Enable Hyper-V Guest Services  $VMNames | Enable-VMIntegrationService -Name "Guest Service Interface"   Foreach ($VMName in $VMNames)  {  Copy-VMFile $VMName -SourcePath $AVMAFilePath -DestinationPath C: -FileSource Host  Invoke-Command -ComputerName $VMName.Name -ScriptBlock {  start-process C:\AVMA.cmd -Verb runas -Expect  Remove-Particular C:\AVMA.cmd -ErrorAction SilentlyContinue}  }  $VMNames | Disable-VMIntegrationService -Name "Guest Service Interface"  Remove-Item C:\AVMA.cmd -ErrorAction SilentlyContinue

Finally, let'due south bank check over again what is the License Status of all Virtual Machines.

# Cheque if the Virtual Machines are activated: LICENSED $cim = New-CimSession -ComputerName (Become-VM).proper name go-ciminstance -class SoftwareLicensingProduct -CimSession $cim | where {$_.name -lucifer 'windows' -and $_.licensefamily -and $_.description -lucifer 'VIRTUAL_MACHINE_ACTIVATION'} | format-list -property Name, Clarification, `              @{Label= "License Status"; Expression={switch (foreach {$_.LicenseStatus}) `               { 0 {"Unlicensed"} `                 1 {"Licensed"} `                 2 {"Out-Of-Box Grace Period"} `                 3 {"Out-Of-Tolerance Grace Period"} `                 4 {"Not-Genuine Grace Period"} `               } } }

Auto-AVMA03

Sure enough there are dissimilar ways to accomplish the same upshot, but yet it has worked for me and I experience that it'southward a much easier than having to actuate each VM manually.

Relish your day!

Cheers,
-Charbel

Source: https://charbelnemnom.com/how-to-automatic-activate-windows-server-2012-r2-virtual-machines-via-powershell-hyperv-powershell/

Posted by: jeffersonwhout1979.blogspot.com

0 Response to "How To Activate Windows Server 2012 R2 Standard Virtual Machine"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel