Forum Discussion
Pat O'Neil
Jun 17, 2019Copper Contributor
Windows 10 Subscription Activation via Powershell
We recently purchased E3 Subscription licenses for Windows 10. Microsoft's documentation states for exisiting enterprise deployments, the following script should be ran via a command line: @echo off...
Pat O'Neil
Jun 27, 2019Copper Contributor
Figured it out. Had to add -filepath after start-process. It now activates the embedded key! Thank you so much!
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($null -ne $ProductKey)
{
start-process -filepath c:\Windows\System32\changePK.exe -ArgumentList "/ProductKey $ProductKey"
}
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($null -ne $ProductKey)
{
start-process -filepath c:\Windows\System32\changePK.exe -ArgumentList "/ProductKey $ProductKey"
}
gastone
Jul 27, 2019Brass Contributor
Totally native Powershell & remote activation:
cls
$computer = $env:computername
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($ProductKey) {
write-debug "set $ProductKey"
$service = get-wmiObject -query "select * from SoftwareLicensingService" -computername $computer
$service.InstallProductKey($ProductKey )
$service.RefreshLicenseStatus()
$service.RefreshLicenseStatus()
write-debug "done"
}else{
write-debug 'Key not found!'
}