Solution: After a ConfigMgr 2007 OSD Task Sequence completes, the client may not automatically pull down policy

Solution: After a ConfigMgr 2007 OSD Task Sequence completes, the client may not automatically pull down policy

  • Comments 9
  • Likes

ToolsWhen a System Center Configuration Manager 2007 OSD Task Sequence completes, the ConfigMgr client may not seem to pull down policy.  Inspecting the ConfigMgr client on the affected PC reveals that under the "Advanced" tab the client is assigned to a site, and the "Discover" button successfully discovers the site. However the following abnormalities are observed:

- Under the "General" tab, the property "Site Mode" is equal to "Unknown".

- Under the "Components" tab, most of the components are Installed but not Enabled. The only enabled components are "ConfigMgr Software Distribution Agent" and "ConfigMgr Software Updates Agent".

- Under the "Actions" tab, only a few actions are available, including "Machine Policy Retrieval & Evaluation Cycle", "Software Updates Deployment Evaluation Cycle", and "User Policy Retrieval & Evaluation Cycle".

- Inspecting the following registry key:

32bit Windows OS
HKLM\SOFTWARE\Microsoft\CCM\CcmExec!ProvisioningMode

64bit client Windows OS
HKLM\SOFTWARE\Wow6432Node\Microsoft\CCM\CcmExec!ProvisioningMode

reveals that it is set to true and that the ConfigMgr client is in provisioning mode.

- Inspecting the following registry key:

32bit Windows OS
HKLM\SOFTWARE\Microsoft\CCM\CcmExec!SystemTaskExclude

64bit Windows OS
HKLM\SOFTWARE\Wow6432Node\Microsoft\CCM\CcmExec!SystemTaskExcludes

reveals that it is not empty and has the following value instead:

SchedulerStartup;SchedulerShutdown;SchedulerLogon;SchedulerLogoff;ClientRegistrationStartup

Clicking on the "Machine Policy Retrieval & Evaluation Cycle" action may cause the PC to start receiving some policy, including additional components being enabled and additional actions being made available.  It may also cause the client to show up as a valid client in the ConfigMgr console, however not all policy is received and certain items such as advertised programs and software updates are never made available.  Additionally, in the ConfigMgr client control panel, under the "General" tab the property "Site Mode" remains "Unknown".

Reinstalling the ConfigMgr client or modifying the above registry keys usually resolves the issue, however this is not an ideal solution since the client should be fully operational when the Task Sequence completes.

Cause

During a ConfigMgr 2007 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.

Normally when the Task Sequence completes and exits cleanly, the ConfigMgr client is automatically taken out of provisioning mode. As soon as the ConfigMgr client is taken out of provisioning mode, it then proceeds to pull down policy from the MP and configure the ConfigMgr client appropriately.

If the Task Sequence does not exit cleanly, the ConfigMgr client may not be taken out of provisioning mode. This may lead to the ConfigMgr client not being configured properly and where it does not pull down policy from the MP. Manual attempts at trying to download policy will only partially succeed since the ConfigMgr client is in provisioning mode and not configured properly.

Please note that Task Sequence not exiting cleanly is not the same as the Task Sequence failing. When Task Sequences fail they usually still exit cleanly. A Task Sequence not exiting cleanly is usually caused by one of the following scenarios:

1. At some point after the "Setup Windows and ConfigMgr" task, a power failure or crash occurs on the PC. At this point the PC may be bootable and the user may be able to log into the PC. However because the Task Sequence never exited cleanly, the ConfigMgr client is left in provisioning mode, and the problem may exist.

2. A "Restart Computer" task at some point after the "Setup Windows and ConfigMgr" task that 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.

This error is common because the "Restart Computer" task defaults to restarting into the WinPE boot image instead of the full Windows OS. The "Restart Computer" task option "The boot image assigned to this task sequence" will cause it to reboot into WinPE, while the option "The currently installed default operating system" will cause it to reboot into the full Windows OS being deployed by the Task Sequence. If the option is not specifically switched from the default setting when the "Restart Computer" task is added to the Task Sequence, then the issue will occur.

3. In Windows XP and Windows Server 2003, if an application is installed during the Task Sequence that installs a custom Gina, the problem will happen. In Windows XP and Windows Server 2003, the ConfigMgr OSD Task Sequence will install a custom Gina called OSDGina. This Gina is used for several reasons during a Task Sequence such as accomplishing automatic log ins between reboots, disabling all user interfaces such as Explorer, etc. If the OSDGina is replaced by another custom Gina, then the Task Sequence cannot end or exit cleanly and the ConfigMgr client will not be taken out of provisioning mode.
Note: Custom Ginas can only be used in Windows XP or Windows Server 2003. Custom Gina issues will not occur in Windows Vista or newer since custom Ginas, including OSDGina, are not used in Windows Vista or newer.

Resolution

To confirm the issue, inspect the registry key to see if it is set to True:

32bit Windows OS
HKLM\SOFTWARE\Microsoft\CCM\CcmExec!ProvisioningMode

64bit client Windows OS
HKLM\SOFTWARE\Wow6432Node\Microsoft\CCM\CcmExec!ProvisioningMode

Additionally, inspect the registry key:

32bit Windows OS
HKLM\SOFTWARE\Microsoft\CCM\CcmExec!SystemTaskExclude

64bit Windows OS
HKLM\SOFTWARE\Wow6432Node\Microsoft\CCM\CcmExec!SystemTaskExcludes

see if has the following value:

SchedulerStartup;SchedulerShutdown;SchedulerLogon;SchedulerLogoff;ClientRegistrationStartup

If either or both of the above is true then the ConfigMgr client is stuck in provisioning mode.

Setting the first registry value to False and blanking out the second registry value will resolve the issue on that particular client, however this will not resolve the issue from occurring again during the Task Sequence on another client.

To determine if one of the tasks in the Task Sequence is causing the problem, disable all tasks after the "Setup Windows and ConfigMgr" task and rerun the Task Sequence. If the Task Sequence completes successfully and the ConfigMgr client successfully processes policy then the problem is with one of the tasks in the Task Sequence after the "Setup Windows and ConfigMgr" task.

To resolve the issue, first determine what is causing the Task Sequence not to exit cleanly:

1. A misconfigured "Restart Computer" task after the "Setup Windows and ConfigMgr" task that finishes the Task Sequence in WinPE instead of the full Windows OS.

2. When deploying Windows XP or Windows Server 2003, an "Install Software" or "Run Command Line" task that installs a custom Gina.

Once the cause of the problem is determined, follow the appropriate section below to resolve the issue.

Note: Do NOT try and resolve the problem by trying to add tasks in the Task Sequence that change the registry keys that sets the ConfigMgr client to provisioning mode. Doing so can cause unexpected behavior and may cause the Task Sequence to fail.

To resolve the issue when caused by a misconfigured "Restart Computer" task:

1. In the ConfigMgr 2007 console, navigate to  "Computer Management" --> "Operating System Deployment" --> "Task Sequences".

2. Right click on the affected Task Sequence and choose "Edit".

3. Locate any "Restart Computer" tasks that exist after the "Setup Windows and ConfigMgr" task and then click on them. Please note that the "Restart Computer" tasks may have been given a custom name.

4. In each "Restart Computer" task, verify that the setting "Specify what to run after restart:" is set to "The currently installed default operating system".

Note: If for some reason the intention is to actually restart the Task Sequence back into the WinPE boot image at some point after the "Setup Windows and ConfigMgr" task, an additional "Restart Computer" task needs to be added to the Task Sequence at some point after the original "Restart Computer" task with the "Specify what to run after restart:" setting properly selected to "The currently installed default operating system".  In other words, for Task Sequence that have "Restart Computer" tasks after the "Setup Windows and ConfigMgr" task, the final "Restart Computer" task in Task Sequence should always have the setting "Specify what to run after restart:" set to "The currently installed default operating system". This will ensure that the Task Sequence complete in the full Windows OS and not in WinPE.

To resolve the issue when caused by an application installing a custom Gina:

1. On a PC that already has the custom GINA installed, take a look at the following registry key and record the name of the custom Gina:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon!GinaDLL

2. In the ConfigMgr 2007 console, navigate to  "Computer Management" --> "Operating System Deployment" --> "Task Sequences".

3. Right click on the affected Task Sequence and choose "Edit".

4. Locate the "Install Software" or "Run Command Line" task that installs the application with the custom Gina.

  • If the task is a "Run Command Line", under the "Command line:" text box, modify the command line and add the appropriate switches or options to suppress reboots. Once done, move on to Step 5. Please note that the appropriate command, options, or switches vary with application installer. Please refer to the product documentation of the application installer for the appropriate command, option, or switch to suppress reboots.
  • If the task is an "Install Software" task, determine the Package and Program that installs the custom Gina.
    1. In the ConfigMgr 2007 console, navigate to "Software Distribution" --> "Packages".
    2. Locate the appropriate Package, expand it and then click on "Programs".
    3. Right click on the appropriate Program and choose "Properties".
    4. Under the "General" tab, next to the "Command line:" box, modify the command line and add the appropriate switches or options to suppress reboots. Please note that the appropriate command, options, or switches vary with application installer. Please refer to the product documentation of the application installer for the appropriate command, option, or switch to suppress reboots.
    5. Click on the "OK" button.
    6. Switch back to the affected Task Sequence.

5. Click on the “Install Software” or "Run Command Line" task that installs the application with the custom Gina, and then go to "Add" --> "General" --> "Run Command Line". This should create a "Run Command Line" task immediately after the “Install Software” or "Run Command Line" task that installs the application with the custom Gina.

6. In the newly created "Run Command Line" task from Step 5:

  • Next to the "Name: " text box, enter in:  Set Custom Gina
  • Under the "Command Line:" text box, enter in: 

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v OSDOldGinaDLL /t REG_SZ /d <Custom_Gina> /f

where <Custom_Gina> is the value obtained from Step 1, i.e. CustomGina.dll. Do not include the brackets <> in the registry key value.

7. Click on the "Capture Custom Gina" Run Command Line task created in Steps 5 and 6 and then go to "Add" --> "General" --> "Run Command Line".   This should create a "Run Command Line" task immediately after the "Set Custom Gina" Run Command Line task.

8.  In the newly created "Run Command Line" task from Step 7:

  • Next to the "Name: " text box, enter in:  Restore OSD Gina

  • Under the "Command Line:" text box, enter in:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v GinaDLL /t REG_SZ /d OSDGINA.DLL /f

9. Click on the "Apply" button to save the Task Sequence.

When the Task Sequence completes, it will use the value stored in the below registry key to restore the custom Gina:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon!OSDOldGinaDLL

Frank Rojas | System Center Support Escalation Engineer

The App-V Team blog: http://blogs.technet.com/appv/
The WSUS Support Team blog: http://blogs.technet.com/sus/
The SCMDM Support Team blog: http://blogs.technet.com/mdm/
The ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
The OpsMgr Support Team blog: http://blogs.technet.com/operationsmgr/
The SCVMM Team blog: http://blogs.technet.com/scvmm/
The MED-V Team blog: http://blogs.technet.com/medv/
The DPM Team blog: http://blogs.technet.com/dpm/
The OOB Support Team blog: http://blogs.technet.com/oob/
The Opalis Team blog: http://blogs.technet.com/opalis

clip_image001 clip_image002

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Great article Frank. Totally a life savor. I am in a situation where my clients are stuck in provision mode. With the help of your article I figured out the root cause of the issue. Unfortunately there are machines that were imaged and deployed in our company. These clients are stuck in provision mode as well. They show up as no client installed in the console. I do not have physical access of these machines to do the changes. What would your recommend to get these clients out of provision mode and initiate the policy so that they become active and report to the primary site. Please advise. Thanks a million.

  • Hi SPB,

    I am dealing with some ConfigMngr clients not reporting properly to the server because they are in provisioning mode. I am planning to implement the two registry keys changes through GPO.

  • Great article. Excellent analyse and solution, as if this blog is written specially for my company :)

  • Hi, I had a similar issue for few of my HP desktops. After I made the appropriate changes mentioned above to the registry, the sccm client started to sync the policies. Thanks

  • You really saved my day! This annoying problem is now fixed. Thank you!

  • thank you very much !!!!

  • thank you very much !!!!

  • This is true for SCCM 2012 SP1 as well. Thank you very muchfor the tip!