How to remove SCCM/SMS Sites from Console

Published on
14,238 Points
3 Endorsements
Last Modified:
Problem Description:

Actually I found the below issue with some customers after migration from SMS 2003 to SCCM 2007 and epically if they change site code, some clients may appear in the console with old site code, plus old sites still appearing in Configuration Manager Console -> Site Management.

So we have two issues now:

1- After discover and deploying CCM agent, we found that some client machines show that Client status is "NO" and site code is "Old site code".
2- In sites Hierarchical, we may find old sites in Configuration Manager console - Site Management.

Note: second point may occur in case we used the same remote site database server and same database for new Configuration Manager.


Client machines with Old site code

As we know Configuration Manager will not automatically change site code unless we manually reinstall the clients to change the site code. So to resolve this issue, we need to check the following:

a. Make sure that the old SMS/SCCM services have been removed from the old SMS server.

b. Clean the Active directory system container for existing SMS server MP and SLP information.

c. Add the site boundaries in SCCM Server.

d. Use login script to run the following script on those problematic client machines.


Set smsClient = CreateObject("Microsoft.SMS.Client")



This script will force those SMS client agent to point to new SCCM site.

e. Remove the clients records with old site code from SCCM console.

f. Re-discover those machines and monitor if the old site code being changed now.

Remove Old sites from ConfigMgr Console

The old SCCM/SMS services have been removed from old Server, However it still appear in new ConfigMgr console Site Management.

According to Microsoft Technet, if you need to start secondary site wizard, you may need to:

1- Navigate to System CenterConfiguration Manager / Site Database / Site Management / <site code> – <site name> / <secondary site code> – <secondary site name>

2- Right-click <secondary site code> and click delete.

But sometimes delete option is not available and reference to the old site still exist in Site Database.

Actually old site codes may still in Configuration Manager Site database and the following task is to delete any references related to old site Database.  

You need to open SQL Enterprise Manager console on server that host SMS/SCCM Database, and do the following:

1- Select ConfigMgr database and Backup Database.
2- Select ConfigMgr database and Run the following queries to delete any reference to the old site.


DELETE FROM SiteBoundaryADSite WHERE SiteCode = ‘XXX’

DELETE FROM SiteBoundaryIPSubnet WHERE SiteCode = ‘XXX’

DELETE FROM SiteControl WHERE SiteCode = ‘XXX’

DELETE FROM SiteControlNotification WHERE SiteCode = ‘XXX’




DELETE FROM PkgServers WHERE sitecode = ‘XXX’

DELETE FROM PkgStatus WHERE sitecode = ‘XXX’

Note: Change XXX to secondary site code

Best Regards

Administrative Comment

by:Glen Knight
Yes, sorry you are right.

I meant backup the database before removing any data from it.  The last thing you want is someone following your advice and lose all their data.
LVL 14

Author Comment

by:Abduljalil Abou Alzahab
Now I got your point, actually schedule for site backup is required, but it's high recommended to backup database before doing any change, I'm agree with you, I'll add it now.

Expert Comment

by:John Hammond
Any idea what the "replacements" are for SiteBoundaryADSite and SiteBoundaryADSite in 2012?

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Check How effective MS Exchange Expert thinks Exchange Mailbox Recovery by SysTools IS. Visit the Official site to get detailed information:- https://www.systoolsgroup.com/exchange-recovery.html (https://www.systoolsgroup.com/exchange-recovery.h…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month