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.
$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: