Friday, 1 August 2014

Remove SharePoint DB without having SQL Management Studio access

Just a quick tip that can help a lot in some situations, when in the situation when you for example have deleted a service application and the DB’s are still there, the DBA’s have all left and you have no way of connecting to SQL with a management tool…

This is what you can do, given that you have the permissions…(high?)

Get-SPDatabase
 (Will list all databases used by SharePoint, Name and GUID and Type.)

$DatabaseToDelete = Get-SPDatabase <GUID of the database you need to get rid of>
 (Load the database as a SPDatabase object)

$DatabaseToDelete.Delete()
 (It’s now gone…)

No comments:

Post a Comment