The Case of Cleaning SCCM

I ran into a problem over the last couple of days that I hadn’t encountered before: a System Center Configuration Manager client that wouldn’t talk to the management server, and wouldn’t uninstall.  This was a Windows 10 laptop, which may have contributed to the issue.  In the end I had to do some googlesleuthing to discover the answer, which required me to go full-on manual uninstall including removing registry keys to actually get the client out.

First I tried the standard ccmsetup.exe /uninstall which did exactly nothing.  I tried both regular and administrator command prompts, but to no avail.  My next step was to use the ccmclean.exe utility that was supposed to rip out any SCCM client install.  For me and the Win10 laptop however, it didn’t get everything.

My final step was to do the manual uninstall.  This requires the following which I found here:

  1. Removing these services (neither of these were present on the Win10 laptop that I could find):
    1. SMS Agent Host Service
    2. CCMSetup Service
  2. Removing the following directories:
    1. %windir%\ccm
    2. %windir%\ccmsetup
    3. %windir%\ccmcache
  3. Removing the following files:
    1. %windir%\smscfg.ini
    2. %windir%\sms*.mif
  4. Removing these registry keys:
    1. HKLM\Software\Microsoft\ccm
    2. HKLM\Software\Microsoft\CCMSETUP
    3. HKLM\Software\Microsoft\SMS
  5. Removing these WMI namespaces:
    1. Root\CIMV2\SMS
    2. Root\CCM

The last step presented a problem as the tools to edit WMI didn’t work on the Win10 computer.  I found some PowerShell commands in the comments section of this page that are supposed to do this instead:

  • get-wmiobject -computername [COMP] -query “SELECT * FROM _Namespace WHERE Name=’CCM'” -Namespace “root” | Remove-WmiObject
  • get-wmiobject -query “SELECT * FROM _Namespace WHERE Name=’sms'” -Namespace “root\cimv2” | Remove-WmiObject

Despite trying them both verbatim, fiddling with syntax, and rewording both as older-style PowerShell code, I couldn’t get either of those to work.  Regardless, once I went through all those steps I was able to reinstall the SCCM client, and it now seems to work correctly.