Hey guys,
I would like to automate the process of my MDT deployment to pull the OEM license key from device and then apply it to windows, If OEM can not be applied, apply VLK. Here is what I have so far:
Powershell
#Get the OEM product key from WMI$ProductKey=$(wmicpathsoftwarelicensingservicegetOA3xOriginalProductKey)[2]#Get the Operating System SKU (Edition) from WMI$OSSKU=(Get-WMIObjectWin32_OperatingSystem).OperatingSystemSKUIF($ProductKey-like"*error*"){<# Keys used in this section are generic keys for installation. None of thesekeys can be activated. These keys are used if Line 2 returns an error. ## Version: Windows 10 Pro x64IF($OSSKU-eq100){cscriptC:\Windows\System32\slmgr.vbs-ipkXXXXX-XXXXX-XXXXX-XXXXX-XXXXXXEXIT}# Version: Other or Not DefinedELSE{ECHO"The edition of the operating system either does not match a defined edition in the script, or is not defined in WMI....<# Keys used in this section are generic keys for installation. None of these