As you know you can uninstall the Configuration Manager 2007 client software from a computer by using CCMSetup.exe with the /Uninstall switch and if you don't want to reinvent the wheel use below script
Using powershell you can do it for single or multiple servers.
Check if path is accessible or notExample
$Server = "DEVAzureServer"
Test-Path -Path "\\$Server\D$\windows\ccmsetup\ccmsetup.exe"
Using Invoke-Command you can Uninstall sscm
Example
$cmds = { C:\windows\ccmsetup\ccmsetup.exe /uninstall }
Invoke-Command -Scriptblock $cmds
Example
$listOfServers = @("Server1", "Server2", "Server3" )
$cmds = { C:\windows\ccmsetup\ccmsetup.exe /uninstall }
#traverse through list of servers
Foreach($svr in $listOfServers)
{
$svr = $svr.Trim()
Write-Host "Processing $svr"
#Check if server exist
$DNSHostByName = ([System.Net.Dns]::GetHostByName(("$svr")))
If(!$DNSHostByName)
{
Write-Warning "$svr does not exist"
}
Else
{
Invoke-Command -Scriptblock $cmds -ComputerName $svr
}
}