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...
Graham Watts
Jun 19, 2019Copper Contributor
Your if statement appears to be missing an evaluation. As you have it originally you have this
if($ProductKey)
So in effect, to quote, "if Product Key what?". What do you want product key to be? I would say you want the script block below to run if the product key is not null/emtpy, correct? So something like this might work
$ProductKey = (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
if ($null -ne $ProductKey)
{
start-process c:\Windows\System32\changePK.exe -ArgumentList "/ProductKey $ProductKey"
}