Reinstall SCCM Client Agent – Proven Method

Prajwal Desai
Posted by Prajwal Desai
Reinstall SCCM Client Agent

In this post I will show you how to reinstall SCCM client agent. Reinstalling SCCM agent involves uninstalling the SCCM agent completely and installing a new instance of SCCM agent.

Before you decide to reinstall SCCM client agent, you may try SCCM client agent repair. With ccmrepair, you can easily repair SCCM client agent using command line. CCMrepair is a utility that comes installed with SCCM client agent. You can use it to repair SCCM client on the computer. In addition, you can also use a script to repair SCCM client agent.

But if you are specifically looking to reinstall SCCM client agent (completely remove and install new agent), there are few steps that you need to follow. A SCCM client agent reinstall can be manually performed on a problematic computer. If the SCCM client agent isn’t working or if you think it’s not installed correctly, you may reinstall the client agent.

When you use the Configuration Manager client install wizard, you also get an option called Always install the client software. You use this method when a computer already has the Configuration Manager client installed and you can repair, upgrade or reinstall the client software.

Reinstall SCCM Client Agent
Reinstall SCCM Client Agent

Steps to Reinstall SCCM Client Agent

Here are the steps to quickly repair the SCCM Agent on client computer.

  • On the client computer, run the cmd prompt as an administrator.
  • Uninstall the SCCM client agent with following command – C:\Windows\CCMSetup\CCMSetup.exe /uninstall
  • Wait for the client agent to uninstall completely. At this point you can monitor the log file (C:\Windows\CCMSetup\CCMSetup.log).
  • Run CCMSetup.exe SMSSITECODE=P01 (P01 is the site code of the Primary Site Server) to reinstall client agent.
  • Again use the CCMSetup.log to verify the client reinstall.

Ok now let’s look at the reinstall steps in detail. On the client computer run the command prompt as administrator. Before we reinstall SCCM client agent, we will first uninstall the client agent from the computer. Run the below command to uninstall the SCCM client agent.

C:\Windows\CCMSetup\CCMSetup.exe /uninstall
Uninstall SCCM Client Agent
Uninstall SCCM Client Agent

The line ccmsetup is exiting with return code 0 confirms the client agent has been uninstalled successfully. There is no restart required here and you can reinstall the SCCM client agent in the next step.

When you uninstall the SCCM client agent, you are left with ccmsetup folder and a sub folder called Logs. In some cases you may find additional folders that will clear up upon a restart. A client uninstall shouldn’t leave anything apart from these two folders. So if you want to reinstall the client agent on this computer, you definitely need the client agent setup files.

If you have installed Configuration Manager on C: drive, the ccmsetup.exe is located under C:\Program Files\Microsoft Configuration Manager\Client folder. Copy the entire client folder to destination computer first. Do not run the setup directly from the site server as the client installation may be delayed.

On the client computer run the command prompt as administrator. Change the path to the folder where you have the SCCM client agent setup files. Run the below to command to reinstall the SCCM client agent on the client computer.

CCMSetup.exe SMSSITECODE=P01 (Where P01 is the site code of the Primary Site Server)
Reinstall SCCM Client Agent
Reinstall SCCM Client Agent

The CCMSetup.exe command downloads required files to install the client from a management point or a source location.

  • The Windows Installer package client.msi that installs the client software
  • Client prerequisites
  • Updates and fixes for the Configuration Manager client

The line ccmsetup is exiting with return code 0 confirms the client agent has been reinstalled successfully. In case you notice CcmSetup is exiting with return code 7 then you must reboot your computer to complete the client agent installation.

Share This Article
Prajwal Desai
Posted by Prajwal Desai
Follow:
Prajwal Desai is a Microsoft MVP in Intune and SCCM. He writes articles on SCCM, Intune, Windows 365, Windows Server, Windows 11, WordPress and other topics, with the goal of providing people with useful information.
4 Comments