In this article, we’ll look at how to remove ConfigMgr primary site or uninstall SCCM primary site from the setup. You can use this guide to quickly delete a primary site.
The steps to remove or uninstall a primary site are simple. However, if you plan to remove a primary site, you must first go through the prerequisites, which are important.
If you have a CAS in your setup, you can also remove the central administration site from the hierarchy, but keep the primary site. You can run Configuration Manager setup to uninstall the CAS that doesn’t have child primary sites.
Reasons for removing a Primary Site in Configuration Manager
Let’s figure out why you want to uninstall or remove a primary site in SCCM. For the following reasons, you might want to uninstall a primary site from your hierarchy:
- Consolidate sites to reduce costs and complexity
- Reconfigure or redesign the sites of the hierarchy
You uninstall a Configuration Manager primary site that has got many issues, and you may want to get rid of it and set up a new site again.
If you are running Configuration Manager in your lab, you may want to remove the existing primary site and build a new one. In such situations, one can consider removing a primary site.
SCCM Site Reset vs SCCM Site Uninstall
There is a difference between site reset and site uninstall in SCCM. Site Reset helps you to re-apply the default files and registry permissions on the site server. It also re-installs each Configuration Manager component. Whereas, a site uninstall will completely remove all the SCCM components from your server.
Refer to the following guide on how to perform SCCM site reset. In this article, we will cover the steps to uninstall SCCM primary site from your setup.
ConfigMgr Site Removal Order
Since you have chosen to remove the SCCM primary site, there are a few things I would like to add here. What if you have a hierarchy with multiple sites? Can you decommission the primary site server directly? The answer is “No.” There is an order that you need to follow for site removal.
When you plan to remove sites in Configuration Manager, the sequence of removal is important. Remember that if your hierarchy has multiple sites, you must start by uninstalling the sites at the bottom of the hierarchy and then move upward.
- First, remove secondary sites attached to primary sites.
- Next, remove the primary sites. We will see how to do that in this post.
- After all the primary sites are removed, you can uninstall the central administration site.
As mentioned earlier, I have got just one primary site in my lab setup. Regardless of the roles that are installed on the site server, we will simply uninstall the configuration manager primary site by following a few easy steps.
Prerequisites to uninstall a primary site in SCCM
The administrative user who runs Configuration Manager setup needs the following security rights:
- Sysadmin rights on the site database
- Local Administrator rights on the primary site server
- If the primary site database server is remote from the primary site server, local Administrator rights on the remote site database server for the primary site.
- Infrastructure Administrator or Full Administrator security role on the Primary site
Note: When a secondary site is attached to the primary site, you must remove the secondary site before you can uninstall the primary site. Refer the following guide to uninstall SCCM Secondary Site.
How to Uninstall SCCM Primary Site
You run Configuration Manager setup to uninstall a primary site that doesn’t have an associated secondary site. Use the following procedure to uninstall a primary site.
Login to the site server and go to Programs and Features. Right-click System Center Configuration Manager Primary Site Setup and click Uninstall/Change.
You will now see system center configuration manager setup wizard. Click Next.
On the Getting Started page, select Uninstall a Configuration Manager site.
Before you uninstall SCCM primary site, there are two options that you see here.
- Do not remove the primary site database.
- Do not remove the Configuration Manager console.
Both these options are self-explanatory. I would not check any of these options, as I want to uninstall the ConfigMgr primary site completely.
You will now see a message box “Are you sure you want to uninstall the SCCM Site?“, on the confirmation box, click Yes.
The primary site uninstallation begins now. There are many steps involved in uninstalling the SCCM primary site, so leave the server idle during the primary site uninstallation. You can click View Log and that will open the ConfigMgrSetup.log file. In my lab set up, the primary site got uninstalled in 14 minutes.
The ConfigMgrSetup.log file records the primary site uninstall process. At the end of the log file, you should see Completed Configuration Manager Server Setup – Uninstallation. This confirms the primary site has been uninstalled successfully.
Peeking into the System Management container, there are no entries related to the primary site server. This means your primary site has been uninstalled cleanly.
Hi Prajwal, what about a full uninstallation of SCCM, one client wants to remove entirely from their system, is the same steps?
If I’m going to uninstall my only primary site and perform a clean reinstall, so I need to uninstall the agents that have been deployed within my environment first (or at all)?
Hi I am getting error to uninstall CAS after failed installation attempt. The uninstallation process is failing with “Cannot continue uninstall, Setup failed to get the number of attached primary sites”. Their is no primary site this is first cas server. Please help. Thanks
I just found “Windows Deployment Services” as an installed Server role. I assume SCCM installed it automatically when I chose that option. I have removed and restarted. Now I just have the 2 services SMS Agent host and SMS_Notification_server. I copied ccmsetup.exe from installation DVD and tried running ccmsetup.exe /uninstall but both of those services are still there. Is there another way to cleanly remove it?
I found the following services still on the server and running:
Windows deployment services server
SMS Agent Host
SMS_Notification_server – not running
I disabled the two and restarted the server and it eliminated the errors, but now I would like to delete the directories
C:\Program Files\Microsoft Configuration Manager and C:\Program Files\SMS_CCM. I am assuming I would get more errors since the one service, SMS Agent Host points to a file in one. I guess I will have to modify the registery. Any other options to get these to properly uninstall?
I followed the above instructions and restarted the server. I received the following errors:
Log Name: System
Event ID: 2511
The server service was unable to recreate the share AdminUIContentPayload because the directory C:\Program Files\Microsoft Configuration Manager\AdminUIContentPayload no longer exists. Please run “net share AdminUIContentPayload /delete” to delete the share, or recreate the directory C:\Program Files\Microsoft Configuration Manager\AdminUIContentPayload.
I followed ran the commands to delete the share and found 3 other shares that pointed to directories under C:\Program Files\Microsoft Configuration Manager and stopped sharing them.
Also received these errors:
Log Name: Application
Event ID: 259
An error occurred while trying to load the module from C:\Program Files\Microsoft Configuration Manager\bin\x64\smspxe.dll for provider SMSPXE. If the provider is marked as critical, the Windows Deployment Services server will be shut down.
Error Information: 0x7E
Log Name: Application
Event ID: 264
An error occurred while trying to initialize provider SMSPXE. Because the provider is not marked as critical, the Windows Deployment Services server will continue to run.
Error Information: 0x7E
Log Name: Application
Event ID: 268
The description for Event ID 268 from source WDSIMGSRV cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
I have a scenario where i have mistakenly installed CAS instead of a Primary site which led me to have to uninstall CAS using the method above. Is there anything I need to do in relation to the prerequisites (SQL, WSUS) before reinstalling as a Primary site? or would it be better to blow away the VM and start from scratch?
This is a great site – all actions are very clearly written and very accurate. Well done to you Mr Desai.