AutomoxAutomox

Worklet: Remove SCCM Agent

derekheld
October 20, 2020 at 5:43 pm UTC

If anyone else is in the same boat of wanting to remove Microsoft System Center Configuration Manager agents from endpoints and servers this is the worklet we used to accomplish it.

Evaluation script (cache folder only exists if client was configured):

4 lines
if( Test-Path -Path "C:\Windows\ccmcache" )
{
    exit 1
}

Remediation script (using official Microsoft method):

2 lines
$process = Start-Process -FilePath "C:\Windows\ccmsetup\ccmsetup.exe" -ArgumentList '/uninstall' -PassThru
Exit $process.ExitCode

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (1)

Roger_GarciaDecember 30, 2021
#1

Hi derek, in otherwise, if i want to use a worklet to install the SCCM client, how would be the evalution code?, when is possible that the machine already has the client installed and the folder exist, but pointing to an old sccm server.

This worklet is intended to be used most over remote machines that connect to system center over VPN.

So the remediation code should works exist or not the ccmcache folder.

I already has the remediation code ready and tested, just need the evaluation code that allow both conditions,  exist or not the ccmcache folder.

 

Any help is appreciate.

Regards