Quantcast
Channel: Spiceworks Community - Latest topics
Viewing all articles
Browse latest Browse all 184226

MDT OEM License Automation

$
0
0

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

Viewing all articles
Browse latest Browse all 184226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>