Wednesday, August 7, 2013

A service application database was deleted in SQL Server Management Studio


Solution
Using PowerShell, run the following command:
Get-SPDatabase | where {$_.exists -eq $false}
This will list all databases in SharePoint that no longer exist on the database server. If you are happy with the result and wish to remove the orphaned databases, run the following command:
Get-SPDatabase | where {$_.exists -eq $false} | foreach {$_.delete()}

Source:
http://www.mysharepointadventures.com/2012/02/cleaning-up-deleted-databases-in-sharepoint/

No comments:

Post a Comment