4

I used Get-SPDeletedSite command to find the deleted Site Collections. It returns Site Collection deleted from UI but it is not listing Site Collections deleted using Remove-SPSite command.

Can anyone explain me about the above scenario and also to figure out the deleted Site Collections?

2

I think you are seeing the effect of a known "issue" I asked about here.

Basically, when checking for a site existence, SharePoint seem to reference some internal caching mechanism. This seem to be the root cause of a site still begin detected as still "existing".

As you can see from the linked discussion, there are actually two different aspects that you should consider when facing with such issues.

  1. Gradual Deletion seem to be a common cause of the problem. As you have experienced from you answer and also confirmed by Chris Beckett here it seems that bypassing the Gradual deletion feature via PowerShell like you did (or manually running the clean-up job afterwards) can help mitigate the problem.

  2. I also had situations where the Gradual Deletion feature didn't seem to be the root cause. While I didn't find a real reason that justifies why my test environments behaved differently from Chris ones (I think performances may have a part in this, with my development test environment begin probably a lot slower that his), if that problem ever occurs to you too it may be worth checking if the SPSite.InvalidateCacheEntry(new Uri(siteCollectionUrl), Guid.Empty); method I pointed out in the other answer may help. It should force the clean up of the internal cache that was causing the wrong results in my environment.

  • My pleasure, @Gokul. I was reading the site and recognized the issue I had to work with in the past, so I decided to add a link to the older discussion as a reference – Hitodama Jun 7 '16 at 18:42
3

Use

Get-SPDeletedSite "/"

to get all the deleted site collections from the root site

Check this link below https://technet.microsoft.com/en-us/library/hh286316.aspx

  • I tried the above mentioned command, but it throwed error saying "Cannot find an SPDeletedSite Object with Id or Url: /" – Gokul Jun 6 '16 at 13:46
2

I found the reason for the above scenario from the below link,

https://technet.microsoft.com/en-us/library/ff607948.aspx

Remove-SPSite -Identity "http://sitename" -GradualDelete -Confirm:$False

This command actually leaves some mark about the deletion of the Site. But without GradualDelete option, Remove-SPSite completely removes the Site Collection leaving no mark.

  • Interesting, I didn't know that, thanks for sharing – Red Jun 6 '16 at 14:15

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.