How to Deploy Windows 10 with a OEM ProductKey from the BIOS with Microsoft Deployment Toolkit

For a customer I had to adjust their Microsoft Deployment toolkit installation to use the OEM Product Key from the BIOS instead of a general Volume Licensing key.

If you want to get the Productkey from the BIOS you can do this with the following Powershell commands:

Software Licensing Service WMI Class information:

Please be aware that by default this class is only available in a Full Windows OS.

Powershell Script:

$Productkey = (Get-WmiObject -Class SoftwareLicensingService).OA3xOriginalProductkey



This will give the 5X5 Productkey as a result.

This can be used with Powershell to input into the Software Licensing Manager tool (SLMGR.vbs) with the /ipk option.

iex "cscript /b C:\Windows\System32\slmgr.vbs -ipk $Productkey"


iex "cscript /b C:\Windows\System32\slmgr.vbs -ato"

Now you can use this script within MDT as well.


Download the PowerShell script and save it to your %DeploymentShare%\Scripts folder

Add a new 'Run PowerShell Script' step to your Task Sequence and configure it with the settings below:


Happy Deploying,...

Comments (4)

  1. P. says:

    Great, thank you very much. I tried bat/cmd/vbs but had trouble with it. This powershell script worked flawlessly.
    Exactly what i was looking for.

  2. katherine says:

    Where in the task sequence would you put this?

    1. ERadix77 says:

      In the full Windows OS part of the Task Sequence.

Skip to main content