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.
https://msdn.microsoft.com/en-us/library/cc534597(v=vs.85).aspx
Powershell Script:
$Productkey = (Get-WmiObject -Class SoftwareLicensingService).OA3xOriginalProductkey
$Productkey
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"
and
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
- Anonymous
January 23, 2017
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.- Anonymous
January 23, 2017
Thanks a lot!
- Anonymous
- Anonymous
June 02, 2017
Hello, I have been using this since january. With OEM 8/8.1/10 key. Works great. Now I have implemented Win10-1703 and no go anymore. For as far as I know the invoke expression and the slmgr still work the same. Could you help me with this. Thanks in advance. (changed email) - Anonymous
August 31, 2017
Where in the task sequence would you put this?- Anonymous
August 31, 2017
In the full Windows OS part of the Task Sequence.- Anonymous
September 12, 2017
i cannot seem to find that task sequences part... do you mean under Install - Install OS? i cannot seem to get this to work. is there anyway of getting it to ignore having to enter a key during install and have the script run once the OS is installed? thanks!
- Anonymous
- Anonymous
- Anonymous
October 03, 2017
Hi. Thanks for the powershell script. It's working as the windows gets activated with the OEM product key. But at the end of the deployment i do get an error. The ZTIPowershell.log shows the below. How can I resolve this issue ?\Microsoft.BDD.TaskSequencePSHost40.exe" "\WDS\UDSJuly2017$\Scripts\SetOEMProductKey.PS1" "C:\MININT\SMSOSD\OSDLOGS" ZTIPowerShell 4/10/2017 11:04:04 a.m. 0 (0x0000)ZTI ERROR - Non-zero return code by ZTIPowerShell, rc = -1073422296 0xC004E028 ZTIPowerShell 4/10/2017 11:04:15 a.m. 0 (0x0000)Event 41002 sent: ZTI ERROR - Non-zero return code by ZTIPowerShell, rc = -1073422296 0xC004E028 ZTIPowerShell 4/10/2017 11:04:15 a.m. 0 (0x0000)