Adding PowerShell alternative since WMIC is not supported on Win11

This commit is contained in:
Andrei-George Stoica 2021-11-15 13:07:39 +02:00 committed by GitHub
parent c521c127a4
commit be6ac5a4be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,6 +249,11 @@ changepk.exe /ProductKey %ProductKey%
) )
``` ```
Since [WMIC was deprecated](https://docs.microsoft.com/windows/win32/wmisdk/wmic) in Windows 10, version 21H1, run this PowerShell alternative:
```console
$(Get-WmiObject SoftwareLicensingService).OA3xOriginalProductKey | foreach{ if ( $null -ne $_ ) { Write-Host "Installing"$_;.\changepk.exe /Productkey $_ } else { Write-Host "No key present" } }
```
### Obtaining an Azure AD license ### Obtaining an Azure AD license
Enterprise Agreement/Software Assurance (EA/SA): Enterprise Agreement/Software Assurance (EA/SA):