Forum Discussion
Windows 10 Subscription Activation via Powershell
OK, I'll admit I didn't validate the actual process you were running initially; it looked visually OK at a first glance.
Some quick playing shows that changePK.exe seems to suck when called via Start-Process or Invoke-Expression. So, what I've done instead is switch to another licensing utility instead, slmgr.vbs.
Try this:
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($null -ne $ProductKey)
{
Start-Process -FilePath "c:\Windows\System32\slmgr.vbs" -ArgumentList "/ipk $ProductKey"
}
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($null -ne $ProductKey)
{
start-process -filepath c:\Windows\System32\changePK.exe -ArgumentList "/ProductKey $ProductKey"
}
- gastoneJul 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!' } - Graham WattsJun 28, 2019Copper Contributor
Interesting! I could have sworn I tried formatting the command fully with the -FilePath in my lab and it didn't work, hence I change over at all.
I'm glad we got there in the end! :)
- Pat O'NeilJun 28, 2019Copper ContributorThe command won't work if you're running it on a VM or a machine without an embedded key in the mobo, so perhaps that's why?
Thank you again for your assistance. I appreciate it quite a bit.- Graham WattsJun 30, 2019Copper ContributorThat could be it.
Either way, glad you got what you need.
No problem, any time!