[Webinar] Streamline your web hosting managementRegister Today


How to remove SCCM/SMS Sites from Console

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

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Join & Write a Comment

Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses
Course of the Month7 days, 14 hours left to enroll

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month