Get #windows 10 digital license with #Powershell #winserv #OSD #WDS

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’

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 = get-wmiObject -query ‘select * from SoftwareLicensingService’
if($key = $service.OA3xOriginalProductKey){
    Write-Host ‘Activating using product Key:’ $service.OA3xOriginalProductKey

    #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.


Follow Me on Twitter @ClusterMVP

Follow My blog

Linkedin Profile Http://

Google Me :

Bing Me :


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 Linkedin Profile Http:// 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

2 thoughts on “Get #windows 10 digital license with #Powershell #winserv #OSD #WDS”

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: