1

We use Powershell with CSOM to remove and provision site collections in SharePoint Online during the development phase. We use the Powershell commands provided by the PnP team like this:

Connect-SPOnline -Url $tenantAdministrationUrl -Credentials $credentials         
Remove-SPOTenantSite -Url $PortalSiteCollectionUrl -SkipRecycleBin
Start-Sleep 15;
Connect-SPOnline -Url $tenantAdministrationUrl  -Credentials $credentials
New-SPOTenantSite -Title $PortalSiteCollectiontTitle -Url $PortalSiteCollectionUrl -Owner $PortalOwnerAlias -Lcid $PortalLanguageId -Template $PortalSiteTemplateName -TimeZone 3 -RemoveDeletedSite

Sometimes the site collections are removed but they somehow still is available in the background as I can't create new site collections at the same url, not by Powershell and not by using the UI. I have also looked in the trash bin for site collections and they are not there either. It's like they are ghost site collections.

Have anyone else experienced this and found a solution for removing them?

0

Have you tried using Get-SPODeletedSite, and if you found anything there run the Remove-SPODeletedSite? This should surely remove any deleted site making the URL available for a new site.

But there may still be references which needs to be removed by a Timer Job. These timer jobs are unfortunately inaccessible to us, and I usually wait to the next hour before I create a new site with the same URL. In the worst case, I had to wait 24 hours before I could proceed.

Unfortunately, we can't force timer jobs to run in an Office 365/SharePoint Online environment. See SharePoint Online Timer Job reference:

Since the timer jobs are managed by Microsoft and no option for users to adjust timer job configuration in SharePoint Online

  • Yep it must have been the timer job issue as I can create a new site collection now. – Niclas Carlsson Apr 8 '15 at 13:12

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.