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
LMGTFY : http://lmgtfy.com/?q=robert+smit+mvp+blog
Like this:
Like Loading...
Author: Robert Smit [MVP]
Robert Smit is Senior Technical Evangelist and is a current Microsoft MVP in Clustering as of 2009.
Robert has over 20 years experience in IT with experience in the educational, health-care and finance industries.
Robert’s past IT experience in the trenches of IT gives him the knowledge and insight that allows him to communicate effectively with IT professionals
who are trying to address real concerns around business continuity, disaster recovery and regulatory compliance issues. Robert holds the following certifications:
MCT - Microsoft Certified Trainer, MCTS - Windows Server Virtualization, MCSE, MCSA and MCPS. He is an active participant in the Microsoft newsgroup community and is currently focused on Hyper-V, Failover Clustering, SQL Server, Azure and all things related to Cloud Computing and Infrastructure Optimalization.
Follow Robert on Twitter @ClusterMVP
Or follow his blog https://robertsmit.wordpress.com
Linkedin Profile Http://nl.linkedin.com/in/robertsmit
Robert is also capable of transferring his knowledge to others which is a rare feature in the field of IT. He makes a point of not only solving issues but also of giving on the job training of his colleagues.
A customer says " Robert has been a big influence on our technical staff and I have to come to know him as a brilliant specialist concerning Microsoft Products. He was Capable with his in-depth knowledge of Microsoft products to troubleshoot problems and develop our infrastructure to a higher level. I would certainly hire him again in the future. "
Details of the Recommendation: "I have been coordinating with Robert implementing a very complex system. Although he was primarily a Microsoft infrastructure specialist; he was able to understand and debug .Net based complext Windows applications and websites. His input to improve performance of applications proved very helpful for the success of our project
View all posts by Robert Smit [MVP]
2 thoughts on “Get #windows 10 digital license with #Powershell #winserv #OSD #WDS”