When you run an OS deployment task sequence in Configuration Manager, you experience the following issues:
- A Refresh or New Computer task sequence doesn’t continue after Windows Setup finishes during the Setup Windows and ConfigMgr step.
The following entry is logged in the
[windeploy.exe] OEM license detected, will not run SetupComplete.cmd
- An In-Place Upgrade task sequence doesn’t continue after the in-place upgrade finishes during the Upgrade Operating System step.
The following is logged in the
[windeploy.exe] Client OS detected: 1
[windeploy.exe] OEM Licensing detected: 1
[windeploy.exe] EnterpriseS or Enterprise or EnterpriseSN or EnterpriseN edition detected: 0
[windeploy.exe] Client OS edition and OEM license detected and no enterprise edition detected, will not run SetupComplete.cmd
[windeploy.exe] Not allowed to run the Setupcomplete.cmd, will not run SetupComplete.cmd
These issues usually occur when you deploy a nonenterprise edition of Windows, such as Windows Professional edition, Windows Embedded, or Windows IoT.
These issues occur because an OEM product key is used during Windows deployment. When an OEM product key is used, Setupcomplete.cmd is disabled. This behavior occurs in both Windows 8.1 and Windows 10. See the following information from Windows Deployment Issues:
[September 2012] Changes in Out-Of-Box (OOBE) Experience
Oobe.cmd and Setupcomplete.cmd are disabled if an OEM product key is used. This is to ensure that end-users reach Start as quickly as possible. If you have any tools or services that use this infrastructure, these must be changed to tasks that occur after the OOBE.
SetupComplete.cmd is a custom script that runs during or after the Windows Setup process. It contains commands to restart the Configuration Manager task sequence after Windows Setup finishes. When SetupComplete.cmd is disabled, the task sequence can't continue after Windows Setup finishes.
To fix the issue, specify the KMS Client Setup Key in the locations where the OEM product key is specified for the version of Windows that you want to deploy. For example, specify the KMS Client Setup Key in the Apply Windows Settings or the Upgrade Operating System step.
If the OEM product key must be used, follow these steps in addition to specifying the KMS Client Setup Key:
- Add a Run Command Line step after the Setup Windows and ConfigMgr step in a Refresh or New Computer task sequence, or after the Upgrade Operating System step in an In-Place Upgrade task sequence.
- In the Run Command Line step, use changepk.exe or slmgr.vbs to specify the OEM key in Command line.
If the OEM key in the BIOS or firmware of the device must be used, run the following PowerShell command to get the key:
Get-CIMInstance SoftwareLicensingService | Select -ExpandProperty OA3xOriginalProductKey
The OEM product key can be specified in the following locations:
- In a Refresh or New Computer task sequence:
- In the Apply Windows Settings step.
- In a custom answer file (Unattend.xml). This file is usually specified in the Apply Operating System step.
- Through variables such as OSDProductKey or ProductKey (in an MDT-integrated task sequence)
- In an In-Place Upgrade task sequence:
- In the Upgrade Operating System step.
- Through the OSDSetupAdditionalUpgradeOptions variable by using the /PKey command line option.
The OEM product key can also be obtained automatically by Windows Setup from the BIOS or firmware of the device. In this case, the following entry is logged in the
MOUPG ProductKey: Product key found in Digital Marker.
MOUPG ProductKey: Validating Product Key for Image.
SPValidateProductKey: Calling PidGenX
MOUPG ProductKey: Product key using pkey edition = [Professional].
MOUPG ProductKey: Matching Install Wim For Exact Editions
MOUPG ProductKey: Matching Install Wim.
MOUPG ProductKey: Matched Professional with Professional
MOUPG ProductKey: Matching Install Wim: Found  matching images.
MOUPG ProductKey: Extracting Eula
MOUPG ProductKey: Product key was successfully validated.
MOUPG ProductKey: Product EditionID = Professional
MOUPG ProductKey: Product InstallChannel = OEM
MOUPG ProductKey: Eula = C:\$WINDOWS.~BT\Sources\Panther\<file>.tmp
MOUPG ProductKey: Valid product key found = [TRUE].