SharePoint - Another Way to Delete Site Collection

 

I had created a site collection. But there is a problem of web-frontend server (I did not know when I created the site), so the page is always in processing. After waiting 40 mins, I closed the page. When the problem of web-frontend server solved, I found the site link already existed, but I cannot connect to site and I cannot delete it in Central Administration.

Try to delete site collection in Application Management, failed
I select my site collection in Central Administration. For example, if I navigate to Application Management > View all site collections> selecte site collection, there is no information on the right side. No database, no adminitrator, nothing.

Use PowerShell to delete site collection, failed
Remove-SPSite -Identity http://domain/sites/sitename"

Nothing change

The Central Administration displayed the site in the sites list, but without any reference to the Content Database where it should have been created. No way to remove it using the web interface (all pages displaying information about the site had no content at all).

Then i thought to clean it up and remove via script.

A simple Get-SPSite returned a valid object. But a subsequent Remove-SPSite failed with the dreaded “Unknown SPRequest error.occurred”.

I had to find a quick solution, like a “force delete” when the site cannot be deleted.

Therefore I used a not so well-known operation on the Content Database object: Microsoft.SharePoint.Administration.SPContentDatabase::ForceDeleteSite (see http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spcontentdatabase.forcedeletesite.aspx).

With this simple PowerShell code I managed to work it out and clean the unwanted or corrupted site.

$site = Get-SPSite http://siteurl
$siteId = $site.Id
$siteDatabase = $site.ContentDatabase 
$siteDatabase.ForceDeleteSite($siteId, $false, $false)

As the Information clearly states in the image As the Information clearly states in the image

 

Reference: https://sharepoint.stackexchange.com/questions/133131/cannot-delete-site-collection-in-central-administration

 

转载于:https://www.cnblogs.com/Bear-Study-Hard/p/10979030.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值