This SharePoint PowerShell tutorial, we will discuss how to forcefully delete a corrupted site collection using PowerShell in SharePoint 2013/2016.
We saw on the central administration page, in view all site collections page we can see the sites are listed there, but when we click on a particular site collection it did not populate the URL, Title, Description Database Name, etc.
Everything was blank. So basically we can not do anything with the site collections only we can see those in the Site Collection List page. We thought to delete the site collections.
Then we try to delete the site collection using PowerShell by using Remove-SPSite command we got the below error:
Delete corrupted SharePoint site collection using PowerShell
Then we follow below PowerShell to delete the corrupted site collection:
You can put the PowerShell script in Windows PowerShell ISE and run the command.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $CorruptedSiteURL ="http://mynewwebapp:42885/sites/MyDeleteSiteCol" $site = Get-SPSite $CorruptedSiteURL $siteGUID = $site.Id $siteDatabase = $site.ContentDatabase $siteDatabase.ForceDeleteSite($siteGUID, $false, $false)
This time it deleted the SharePoint site collection successfully.
You may like following PowerShell SharePoint tutorials:
- Hide Document Library or Lists using PowerShell in SharePoint 2016/2013
- SharePoint 2013 backup and restore using PowerShell
- Delete SharePoint list using PowerShell
- Delete SharePoint list view and set a list view as default view using PowerShell
- Check in and Check out default page using PowerShell in SharePoint 2013
- Create a managed path in SharePoint 2013/2016 using PowerShell
- PowerShell check if a SharePoint feature is activated
- SharePoint 2013/2016: Get all ListTemplates from Site collection using PowerShell
- Activate publishing feature in SharePoint 2013/2016 using PowerShell
- SharePoint 2013/2016: Get Site Collection or Site Created Date using PowerShell
- Get SharePoint installed build version using PowerShell
- Get all Sites and subsites under web application using PowerShell in SharePoint 2013
- Get SharePoint List Name and GUID using PowerShell and CSOM
- How to find ULS log details based on correlation id using PowerShell in SharePoint 2016/2013
- PowerShell to get all Sites and Subsites under Site Collection using PowerShell
- SharePoint copy files between document libraries using PowerShell with versioning
Here we learned how to delete corrupted site collection using PowerShell in SharePoint 2013/2016.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.