01 August 2013

Activate Windows in PoweShell

Use this following script to activate your Windows machines through the PowerShell.  PSREMOTE onto the machine and just replace all the XXXXXs with your valid key

$computer = hostname
$key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
$service = get-wmiObject -query "select * from SoftwareLicensingService" -computername $computer
$service.InstallProductKey($key)
$service.RefreshLicenseStatus()

No comments:

Post a Comment