[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


How to remove SCCM/SMS Sites from Console

Published on
14,571 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

Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Join & Write a Comment

A query can call a function, and a function can call Excel, even though we are in Access. This is Part 2, and steps you through the VBA that "wraps" Excel functionality so we can use its worksheet functions in Access. The declaration statement de…
Basic Overview of office 365 user portal

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month