Transitioning from hybrid Microsoft Endpoint Configuration Manager (SCCM) co-management to 100% cloud-native Microsoft Intune is the ultimate milestone in Modern Workplace maturity. However, simply shifting sliders in the Co-management dashboard does not cleanly remove the on-premises SCCM agent footprint.
Automated CCMExec Uninstallation & Registry Cleanup Script
# ==============================================================================
# Complete SCCM Agent (CCMExec) Removal & Cleanup Script
# ==============================================================================
Write-Host ">>> [1/3] Triggering CCMSetup.exe /uninstall..." -ForegroundColor Cyan
$ccmSetup = "$env:SystemRoot\ccmsetup\ccmsetup.exe"
if (Test-Path $ccmSetup) {
Start-Process -FilePath $ccmSetup -ArgumentList "/uninstall" -Wait
}
Write-Host ">>> [2/3] Terminating residual CCM services..." -ForegroundColor Cyan
Get-Service -Name "ccmexec" -ErrorAction SilentlyContinue | Stop-Service -Force -ErrorAction SilentlyContinue
Write-Host ">>> [3/3] Purging legacy SMS certificates and registry keys..." -ForegroundColor Cyan
Remove-Item -Path 'HKLM:\SOFTWARE\Microsoft\CCM' -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path 'HKLM:\Software\Microsoft\SystemCertificates\SMS\Certificates\*' -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "✅ Endpoint is now 100% cloud-native Intune managed." -ForegroundColor Green