You could try using the Hierarchy Maintenance Tool Preinst.exe found in the <install_directory>\bin\i386\<language code>
(See http://technet.microsoft.com/en-us/library/bb693624.aspx) which can be used to remove secondary site objects when the /deljob
and /delsite
switches are used. This command can also be used to remove primary sites from a central site however you should log a call with Microsoft if you get in that far.
If you are going to rebuilt this server then you should disable all SCCM services before continuing.
Preinst.exe would be used by issuing both of these commands sequentially:
preinst.exe /deljob <child_site_code>
preinst.exe /delsite <child_site_code> <parent_site_code>
If the site does not disappear from the SCCM console after about 30 mins to an hour (it may take longer if you have a busy SCCM site hierarchy) then you can use the following queries against the parent primary SCCM site database to clean up the entries.
Make sure you do a full backup of you primary and central sites.
DELETE FROM SysResList WHERE SiteCode = 'XXX'
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 Sites WHERE SiteCode = 'XXX'
DELETE FROM Sites_DATA WHERE SiteCode = 'XXX'
DELETE FROM SiteWork WHERE SiteCode = 'XXX'
DELETE FROM PkgServers WHERE sitecode = 'XXX'
DELETE FROM PkgStatus WHERE sitecode = 'XXX'
Microsoft does not support or recommend altering the SCCM database outside of the functions in the SCCM console.
Hope this helps.