Hey All, I recently switched to Automox from Manage Engine’s Patch Manager and wanted an easy way to remove the Manage Engine agent from my systems. In talking with Nic, I found out this would be a perfect job for a worklet. So here’s my first Worklet 😃
Evaluation Code:
Keeping this one super simple as I don’t need it to check if it’s already there since the MSI command for remediation will do that and remove it.
exit 1
Remediation Code:
This works on Windows systems and checks if Manage Engine’s Agent is already installed and then calls the uninstall by the ID since an option exists to hide the program from the Uninstall Programs list.
Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList '/x{6AD2231F-FF48-4D59-AC26-405AFAE23DB7}', 'MSIRESTARTMANAGERCONTROL=Disable', 'REBOOT="ReallySuppress"', '/qn' -Wait -NoNewWindow
If anyone else has improvements for this, please feel free to add them, but after testing this on my system it works just fine as-is.