When rebuilding your windows 10 desktop that hold a digital license key there is no piece of paper that tells you the activation key.
with the following command you can read the product key
$service = get-wmiObject -query ‘select * from SoftwareLicensingService’
$service.OA3xOriginalProductKey
$key=$service.OA3xOriginalProductKey
this is handy for getting the key but when you are deploying a WDS image and everything needs to be unattended you will need a little PowerShell script
As an option there to place a different key for if you are in a mixed environment.
$service = get-wmiObject -query ‘select * from SoftwareLicensingService’
$service.OA3xOriginalProductKey
$key=$service.OA3xOriginalProductKey
$service.InstallProductKey($key)
$service = get-wmiObject -query ‘select * from SoftwareLicensingService’
if($key = $service.OA3xOriginalProductKey){
Write-Host ‘Activating using product Key:’ $service.OA3xOriginalProductKey
$service.InstallProductKey($key)
}else{
#Write-Host ‘Key not found., use a different license’
# $service.InstallProductKey(‘Put your License KEY here’)
}
Save this as a Powershell script and put this in the unattended.xml and when deploying the Windows 10 will be auto activated
Get the script from the site or from the TechNet gallery.
https://gallery.technet.microsoft.com/Get-windows-10-digital-7653fae4
Follow Me on Twitter @ClusterMVP
Follow My blog https://robertsmit.wordpress.com
Linkedin Profile Http://nl.linkedin.com/in/robertsmit
Google Me : https://www.google.nl
Bing Me : http://tinyurl.com/j6ny39w
Pingback: Get Windows 10 digital license with Powershell - How to Code .NET
Pingback: Helpful Windows Admin Tips | Matt Slay, PhC