In this post I will show you how to uninstall ConfigMgr client from Windows Server Core. You can either uninstall the SCCM agent manually from Server Core or use a script.
In my previous post, I covered on installing the SCCM agent on Windows Server Core. However when it comes to uninstalling the client agent, the process is bit different.
There are lot of interesting things that you could do on Windows Server core with Software Center. To know more about that read my post – https://www.prajwaldesai.com/sccm-software-center-on-windows-server-core/.
So I will cover two methods to perform client uninstall. First we will look at manually uninstalling the SCCM agent from Server Core. Second, we will use Run Script feature and run the uninstall command to remove SCCM client agent.
In the first method we uninstall the Configuration Manager client software from a computer by using CCMSetup.exe with the /Uninstall property. This is what Microsoft also recommends. This method works whenever you want to uninstall the agent, be it client or a server.
Second method, we will use Run Scripts feature and deploy the same command to uninstall the agents from Server Core. You may also run the script on a device collection so that you remove the SCCM agents from multiple servers.
Manually Uninstall ConfigMgr Client from Windows Server Core
You can manually uninstall ConfigMgr client from Windows Server Core by running a simple command – ccmsetup.exe /uninstall.
- Run the command prompt as administrator.
- Change the path to client agent location – C:\Windows\ccmsetup.
- Run the command ccmsetup.exe /uninstall.
- Go to C:\Windows\ccmsetup\Logs and open ccmsetup.log file to monitor the client uninstallation.
- Restart your computer after you uninstall the client agent.
Launch the CMTrace tool and open the ccmsetup.log file from %windir%\ccmsetup\logs\. Wait while the client agent uninstalls and when it’s complete, restart your server.
CCMSetup.exe /Uninstall Using Run Scripts
The manual client agent uninstall method is feasible when you have just one server or probably few servers. What if you have more servers and you want to uninstall agents at once ?.
Again we use the CCMSetup.exe with the /Uninstall property to uninstall the agents. However we will run it using Run Scripts feature.
First of all in the Configuration Manager console, go to Software Library\Overview\Scripts. Right click Scripts and select Create Script. Specify the script name such Uninstall ConfigMgr Agent and enter the script below.
What you enter is the following command – C:\Windows\ccmsetup\ccmsetup.exe /uninstall. Complete the remaining steps. When you do that, right click the Script and click Approve. You must approve the script before you deploy it.
You can either deploy this script to a device collection or a single computer. Right click the Server Core device and click Run Script. Select the ConfigMgr agent uninstall script and click Next. Complete the rest of the steps.
On your Windows Server Core machine, launch CMtrace tool and open the ccmsetup.log file to monitor the client agent uninstall.