tags:

views:

319

answers:

2

Is there a command to delete the entire web application (database, iis sites etc) using the Sharepoint admin tool?

I know the same can be done in the central admin, but i have a need to automate this process as we want our build servers to rebuild the sharepoint site from scratch each night.

+1  A: 

Hi.

You should be able to do that with the stsadm unextendvs operation.

stsadm -o unextendvs -url http://MySite -deletecontent -deleteiissites
Magnus Johansson
A: 

In addition to the unextendvs stsadm command you will need to drop the table in SQL. Using this command to remove the content database will remove the link from the content database to the SharePoint web application, but I don't think it will actually drop the SQL table.

So if you are running this every night be sure to either re-use the same content database or also script the table drop to ensure your SQL environment does not end up with abandoned tables.

Peter Jacoby