0

I am facing a strange problem on my SharePoint Enterprise 2013. I have previously deleted some site collections from central administration. Now I want to remove them permanently. So I run the following powershell commands:-

>>Get-spdeletedsite

Then I run the following command on each site collection:

>>Remove-spdeletedsite <<site id>>

but I will get the following error on some site collections:

Unable to find the specified file

Here is a screen shot of my scripts: enter image description here

I remember that when I removed these site collections from central administration, some exceptions occurred and these SCs kept appearing under the site collection list inside CA without site collection admins. So I remove then using powershell commands, but now I am unable to remove them permanently.

EDIT Here are the related logs (after i have enabled verbose logging) when i try to run the following powershell script remove-spdeletedsite <siteid>:-

10/15/2015 15:45:01.71  PowerShell.exe (0x08D0)                     0x2798  SharePoint Foundation           PowerShell                      6tf2    High        System.IO.FileNotFoundException: Unable to find the specified file.     at Microsoft.SharePoint.Administration.SPDeletedSite.Delete(Boolean isForMigration)     at Microsoft.SharePoint.PowerShell.SPCmdletRemoveDeletedSite.DeleteDataObject()     at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() 11ab2dee-3240-49ac-a058-c72585a8f549
10/15/2015 15:45:01.71  PowerShell.exe (0x08D0)                     0x2798  SharePoint Foundation           PowerShell                      91ux    High        Error Category: InvalidData    Target Object  Microsoft.SharePoint.PowerShell.SPCmdletRemoveDeletedSite  Details  NULL  RecommendedAction NULL  11ab2dee-3240-49ac-a058-c72585a8f549
10/15/2015 15:45:01.89  NodeRunner.exe (0x0A74)                     0x218C  SharePoint Foundation           General                         narq    Verbose     Releasing SPRequest with allocation Id {ED9DD0DD-04D8-47A7-B8EC-817A195A8B98}    
10/15/2015 15:45:01.89  NodeRunner.exe (0x0B04)                     0x0ACC  SharePoint Foundation           General                         narq    Verbose     Releasing SPRequest with allocation Id {F3D78E11-A9AD-470B-9523-5B30F5320FAB}    
10/15/2015 15:45:01.89  SPUCHostService.exe (0x2C94)                0x1660  SharePoint Foundation           Sandboxed Code Service          ei0r    Verbose      - Monitoring read perf counters for process "SPUCWorkerProcess": PercentProcessorTime=6.911171E-07 ProcessVirtualBytes=7.166607E+08 ProcessHandleCount=380 ProcessThreadCount=15 ProcessIOBytes=0   
10/15/2015 15:45:01.89  SPUCHostService.exe (0x2C94)                0x1660  SharePoint Foundation           Sandboxed Code Service          ei0r    Verbose      - Monitoring read perf counters for process "SPUCWorkerProcessProxy": PercentProcessorTime=0.1865803 ProcessVirtualBytes=1.122054E+09 ProcessHandleCount=729 ProcessThreadCount=30 ProcessIOBytes=4.837582E-07  
10/15/2015 15:45:01.95  w3wp.exe (0x1E5C)                           0x1EDC  SharePoint Foundation           General                         narq    Verbose     Releasing SPRequest with allocation Id {057EF76A-EE68-4DE9-B9F7-9608C66F912A}    
10/15/2015 15:45:02.01  w3wp.exe (0x04D4)                           0x1168  SharePoint Foundation           General                         narq    Verbose     Releasing SPRequest with allocation Id {253150D6-10E9-4F56-A1D1-CF4990DDD444}    
10/15/2015 15:45:02.01  SPUCHostService.exe (0x2C94)                0x1B40  SharePoint Foundation           General                         narq    Verbose     Releasing SPRequest with allocation Id {75C05F08-EFE8-4CC3-9907-2A831B06A202}    
10/15/2015 15:45:02.01  NodeRunnerContent1-95a90d97-e7d (0x1EA8)    0x10B0  Search                          General                         ahjoj   Verbose     Getting Correlation Header failed, no correlation ID.    
0

Try:

$ds = Get-SPDeletedSite | ?{$_.SiteId -eq "<your guid>"} Remove-SPDeletedSite $ds

  • can you advice please what i need to add inside the "your guid" ? is this same as site id ? – john Gu Oct 14 '15 at 16:08
  • Yep, the SiteId value. – Trevor Seward Oct 14 '15 at 16:12
  • i wrote the following "$ds = Get-SPDeletedSite | ?{$_.SiteId -eq "fd8e55ea-bd58-42d7-b415-92e0391277f6"} Remove-SPDeletedSite $ds" but i received the same error " Unable to find the specified file " – john Gu Oct 14 '15 at 17:22
  • Using the same $ds variable in your Get cmdlet, try $ds.Delete(). If that doesn't work, examine the ULS logs at the point of attempted deletion. – Trevor Seward Oct 14 '15 at 17:28
  • i tried $ds.Delete() ,, but i got this error "Exception calling "Delete" with "0" argument(s): "Unable to find the specified file." At line:1 char:1 + $ds.Delete() + ~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FileNotFoundException" – john Gu Oct 15 '15 at 0:23
0

The error “Unable to find specified file” comes when there is any dependencies (features, webpart, custom template or etc..) previously there but now missing for example earlier some of the functionality was available but now that is not available. You can try the debugging steps here You can try to use “force delete” when the site cannot be deleted you have to add the site id and database id to the code and check. $site = Get-SPSite http://yoursiteURL $siteId = $site.Id $siteDatabase = $site.ContentDatabase $siteDatabase.ForceDeleteSite($siteId, $false, $false)

  • again Get-SPSite will not work !!! as i can not get the site using the URL – john Gu Oct 21 '15 at 16:20
0

This command was only able to remove the site !!!

stsadm.exe -o deletesite -force -siteid 0******3  -DatabaseServer *******\SharePoint -DatabaseName WSS_Content 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.