SCCM 2012 R2 client is stuck in provisioning mode

Today we experienced issues during a Windows 7 deployment. The customer had SCCM 2012 R2 with a Windows 7 OSD and everything seemed to run perfect, except we had the following issues:
– The SCCM client didn’t fully install – it remains in a Site Mode = Unknown 
– The client certificate was not assigned
– The _SMSTaskSequence folder created on C:\ was not removed

We’re deploying our images in a Greenfield scenario.

Configmanager Client error
-No client certificate installed

Provisioning Mode SCCM
 After some investigation we discovered that the SCCM client was still in provisioning mode.

Cause:
Just a little bug.
During a ConfigMgr 2012 R2 OSD Task Sequence, the ConfigMgr client is purposely placed in a provisioning mode. In this mode, the ConfigMgr client does not pick up policy from the MP. This is done so that advertised programs, software updates, and tasks targeted to existing client PCs do not run until the Task Sequence completes. If advertised programs, software updates, or tasks attempt to run while the Task Sequence runs it may interfere with the Task Sequence and cause it to fail.

A Reboot step in the OSD Task Sequence is accidentally set to restart into the WinPE boot image assigned to the Task Sequence instead of the full Windows OS. This will cause the Task Sequence to end in WinPE. Because the ConfigMgr client is actually installed as part of the full Windows OS and not WinPE, and because the Task Sequence ends in WinPE instead of the full Windows OS, it cannot properly take the ConfigMgr client out of provisioning mode.

Solution:
Right after the “Setup Windows and ConfigMgr” step, add two “Run Command Lines” to set the registry values correctly. Here are the two commands to be run:

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\CcmExec /v ProvisioningMode /t REG_SZ /d false /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\CcmExec /v SystemTaskExcludes /t REG_SZ /d “” /f

This forced the client from going out of provisioning mode.
Problem was fixed!

Detail monitoring SCCM 2012 OSD task sequence in the SCCM console

When rolling out OSD in SCCM 2012 R2, one of the major drawbacks is that there is no feedback on how the rollout of the task sequence is functioning accept in the log files. We can build this information in the reports, but the Status Messages is really the preferred place for this.

This article will guide you on how to create a Status Message Query for a Specific OSD like the example below:
OSD logging SCCM 2012 R2
Ok so let’s get started!

First you need to get the deployment ID of the Task Sequence you wish to monitor.
-Go to Monitoring, Overview, Deployments. (The Deployment ID are not displayed by default so you have to select this) and write down the DeploymentIDDeploymentID

Next we are going to build the Status Message Queries:
-Go to Monitoring, Overview, System Status, Status Message Queries, right click and choose Create Status Message Query.
-Give the Status Message Query a name, and click Edit Query Statement
Message Query SCCM 2012
-In the General Tab choose Show Query Language and paste in the following text;
Be sure to replace the collection ID into the one you looked up.

select
SMS_StatusMessage.*,
SMS_StatMsgInsStrings.*,
SMS_StatMsgAttributes.*,
SMS_StatMsgAttributes.AttributeTime
from SMS_StatusMessage
left join SMS_StatMsgInsStrings
on SMS_StatMsgInsStrings.RecordID = SMS_StatusMessage.RecordID
left join SMS_StatMsgAttributes
on SMS_StatMsgAttributes.RecordID = SMS_StatusMessage.RecordID
where SMS_StatMsgAttributes.AttributeID = 401 and SMS_StatMsgAttributes.AttributeValue = “P0120125
and SMS_StatMsgAttributes.AttributeTime >= ##PRM:SMS_StatMsgAttributes.AttributeTime## order by SMS_StatMsgAttributes.AttributeTime DESC

Query
-Click OK, and complete the wizard.
Now we’re ready to launch the Query:
-In the State Message, right click the query and select the date and time (default 1 hour ago), and click OK.
ScreenHunter_29 Apr. 16 14.26

 

Wel we are ready to monitor the deployment like we would expect!
OSD logging SCCM 2012 R2