I learned today that there is a very useful, but semi-hidden command that STSADM has called deleteconfigurationobject. From what I can tell, it deletes an object from the configuration database. Use caution when using this. I have used it when I need to delete a web site, web site application pool, database from the configuration database so that I can create a new one. This is particularly helpful when something gets corrupt.
The syntax is
STSADM -o deleteconfigurationobject -id "<object id>"
To figure out what the object id is, you will need to use SQL.
To find the object id easiest way is to just search by the common name of the object. To do that, follow these instructions.
- Open MS SQL Management Studio and open a new Query tab for the configuration database. Typically, this is the database with Config in it. Depending on the installation of SharePoint this could have been set to something else when it was installed.
- Do a query similar to the following
select id from [Objects] where [Name] like '%MySite%'
- Copy the id, which is a GUID, and execute the STSADM -o deleteconfigurationobject -id command on the SharePoint server.