Re-create missing SMS Agent Host (CcmExec) service with sc.exe

Decorative title image of terminal clip art, Microsoft Endpoint Configuration Manager logo, and error (circle with red “X”) clip art

All product names, logos, and brands used in this post are property of their respective owners.

I lack the blog posts to prove that I spend any appreciable time with Microsoft Endpoint Configuration Manager (SCCM). But I promise I do! In this post, I will outline the symptoms and resolution to a strange Configuration Manager client issue I recently encountered.

The issue

The high-level problems with the Config Manager client were:

  • The device reported “Inactive” in the Configuration Manager console.
  • Running any action or cycle (Actions tab of Config Manager Control Panel) resulted in the “The selected cycle cannot start” error message. Screenshot of SCCM Control Panel error message resulting from running any cycle from the Actions tab: “The selected cycle cannot start”
  • The SMS Agent Host (CcmExec) service was not present under Services on the device.
  • Attempting a client uninstall + reboot and re-install failed, leaving C:\Windows\ccmsetup empty (except for the Logs and cache folders), but the contents of C:\Windows\CCM intact. Re-installing did not create the SMS Agent Host service.

In brief, the Endpoint Manager client seemed stuck in a broken state where it could not be cleanly uninstalled or re-installed, BUT most components still existed on the device. Most notably, the contents of C:\Windows\CCM.

The fix: Re-create the missing SMS Agent Host (CcmExec) service with sc.exe (sc)

As with most technical guidance, proceed with the following at your own risk. Although this fix worked in my environment (SCCM 2107), that may not hold across the board.

Since the only missing piece of the SCCM client on the device was the CcmExec service, I decided to try and create it manually using sc:

sc.exe create CcmExec displayname= "SMS Agent Host" binpath= "C:\Windows\CCM\CcmExec.exe" type= own start= delayed-auto depend= Winmgmt
sc.exe description CcmExec "Provides change and configuration services for computer management systems."

Lo and behold, that did the trick! After starting the new service, the Configuration Manager client resumed normal operation. The device began reporting “Active” in the console, and running actions in the Config Manager Control Panel worked as expected.