Prepare ConfigMgr Client for Capture

Image

Prepare ConfigMgr Client for Capture

This step is essential for a build and capture task sequence. It is closely related to the Prepare Windows for Capture Step. To see the full impact of this step, we really have to see how it interacts with the remainder of the TS after it’s called, which is why if you scroll down, you see a pile of logs. This post is really stealing the thunder from the Prepare Windows step.

MS Docs

https://docs.microsoft.com/en-us/mem/configmgr/osd/understand/task-sequence-steps#BKMK_PrepareConfigMgrClientforCapture

PowerShell

Variables

  • SMSTSUninstallCCMClient

The Step

Prepare CM Client 01

When you create a default build & capture TS, it places the step in the correct place for you.

Process

  • step starts phase 1

    • osdpreparesmsclient.exe runs
    • step triggers restart to clear any pending operations
    • machine restarts back into task sequence
  • step continues into "phase 2"

    • system check
    • clears CM Cache
    • stops ccmexec service
    • removes policy and unassign client
    • resets root key
    • deletes instance of CCM_CLient
    • deletes any TS execution requests
    • deletes any maintenance tasks
    • resets registration to "not registered"
    • disables provisioning mode
    • cleans up TS Policy
    • deletes polcies in WMI
    • sets SMSTSUninstallCCMClient variable to TRUE
    • returns "SMS CLient has been successfully prepared for OS capture"

    The step is then complete. The Client is then uninstalled at the end of the Prepare OS step just before it reboots to capture.

I’m going to go pretty heavy on the logs here to show the entire process, and to actually see the entire process. Here at the start you see the Prepare CM Client step run, where it triggers and restarts the machine, then when the machine comes back to life, starts to do a lot of the prep work as I listed above.

Prepare CM Client 13
Prepare CM Client 12
Prepare CM Client 11
Prepare CM Client 10
Prepare CM Client 09
Prepare CM Client 08
Prepare CM Client 07
Prepare CM Client 06
Prepare CM Client 05
Prepare CM Client 04
Prepare CM Client 03

The Client left behind a few items, but overall it’s gone:
Prepare CM Client 14

At this point, the machine can be captured as it ran Prepare steps beforehand.

Recently I used this step for creating our Non-Persistent VDI Image. It worked brilliantly to have the client removed at the end of the TS in a supported way.

NOTE

The SMSTSPostAction variable does NOT work if you have the client removed.

If you add the step into a normal OSD task sequence, a non-build and capture, but OSD task sequence, it does bad things.
It will not uninstall the CM Client by default, but when you finally get into the full os, the CM Client is completely crippled and not assigned to any site. The Task Sequence will complete, but hang for about 30 minutes for a timeout.

Prepare CM Client 15 Prepare CM Client 16 Prepare CM Client 17

If you cheat and set SMSTSUninstallCCMClient to TRUE before that step, then the Client will actually uninstall directly after the reboot that the step initiates.

Prepare CM Client 18
Prepare CM Client 19

The Task Sequence dies at this point and exits out to Windows. The CM Client is gone and just a few logs are left behind.

Prepare CM Client 20

Hopefully this information was helpful, often times you won’t need to troubleshoot this step, but it is nice to know what is going on behind the scenes.

About Recast Software
1 in 3 organizations using Microsoft Configuration Manager rely on Right Click Tools to surface vulnerabilities and remediate quicker than ever before.
Download Free Tools
Request Pricing

See how Right Click Tools are changing the way systems are managed.

Immediately boost productivity with our limited, free to use, Community Edition.

Get started with Right Click Tools today:

Share this:

en_USEnglish