Forcefully delete site collection ~ บริการดูแลระบบคอมพิวเตอร์ IT Outsource IT Support



Forcefully delete site collection

Today I found a site collection on a customer environment which gave a completely blank page when you opened it via a browser. It didn’t gave a 404 (Not Found) error, it was just a blank page. I decided to figure out what was happening and found that during the creation of the site collection, an IISRESET had taken place. Because of this, the site wasn’t completely provisioned. Well, if it wasn’t completely provisioned, I don’t need it… Nobody could have added content.
I found out that I couldn’t remove the site using Central Administration. When you navigate to the site collection using the “Delete a site collection” page, the details (right hand site of the page) where not loaded and you cannot select the site collection. So… I wanted to delete the site using PowerShell, but this gave me an error:
PS C:\Users\macaw> remove-spsite http://dms/case/P68430ConfirmAre you sure you want to perform this action?Performing the operation “Remove-SPSite” on target “http://dms/case/P68430“.[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”): Yremove-spsite : <nativehr>0x80070003</nativehr><nativestack></nativestack>At line:1 char:1+ remove-spsite http://dms/case/P68430+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidData: (Microsoft.Share…mdletRemoveSite:SPCmdletRemoveSite) [Remove-SPSite], DirectoryNotFoundException+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSite
Apparently, the normal remove-spsite cmdlet cannot delete a site collection which is not fully provisioned, and this cmdlet doesn’t have a force flag. To forcefully delete the site collection, I used the SPContentDatabase.ForceDeleteSite method:
$siteUrl =http://dms/case/P68430$site = get-spsite $siteUrl$siteId = $site.Id$siteDatabase = $site.ContentDatabase$siteDatabase.ForceDeleteSite($siteId, $false, $false)
สระว่ายน้ำ | คลอรีน | คลอรีน 90% | เดินสาย lan | ดูแลระบบคอมพิวเตอร์ | it outsource | เช่ารถเครน | ดูแลระบบคอมพิวเตอร์ | it outsource | it support | รองเท้ามือสอง | ดูแลระบบคอมพิวเตอร์ | it outsource | seo

ไม่มีความคิดเห็น:

แสดงความคิดเห็น