Forum Discussion
Reusing a Deleted SharePoint Site Name
- Jun 06, 2018
Similarly, you can permanently remove the deleted site using Remove-SPODeletedSite cmdlet.
This appears to still be an issue. I deleted a site and am looking to recreate with a different template. the Get-SPODeletedSites commandlet comes back clear with no deleted sites found. the site does not show in the Get-SPOSites either. The site was deleted and removed in PowerShell.
Trying to recreate the site it allows the same site name but puts a 2 on the site name for the URL. Is there a database that needs cleared for the URL to be reused?
- jfranzSep 16, 2019Brass Contributor
Tim Miller Sounds like you are having the same issue I was except I used the Central Admin console. My understanding is if you delete a site it goes into the site administration recycle bin where it sits for 30 days. You can force it to delete which would free up the old URL to be reused but it sounds like it is still in your site collection recycle bin but you aren't seeing it. Wondering if it is still a problem or if it cleared after some time? If you go into the Central admin and go to deleted sites do you see anything there? My understanding is once it's cleared from that site admin recycle bin that's it, it should be clear.
- Tim MillerSep 17, 2019Copper Contributor
jfranz I have used both powershell and admin console.
In PowerShell running Get-SPOSite and Get-SPODeletedSite, both outputs do not have the site listed so there is nothing to Remove-SPODeletedSite on. I have also tried the Clear-PnPTenantRecycleBin wich came up with nothing as well.
In the Admin console the site does not show in the active or deleted sites lists.
to the best i can see the site is deleted and gone but I still get the "2" on the URL when recreating the site. is there a database that the URL is stored in and a PS command to remove it maybe? im at a loss
- koatesSep 30, 2020Copper Contributor
Tim Miller , I was having the same issue. It turned out it was a lingering Redirect that was holding onto the URL I wanted. This was most likely caused by me renaming the site before the deletion in an attempt to free the original name.
I discovered this by going to the desired site in the browser and noticing that it Redirected me to the now deleted site.
The
Remove-SPOSite -Identity https://contoso.sharepoint.com/sites/DesiredSiteName
command can be used to remove the Redirect. Note that I don't believe that site will appear in the list of Get-SPOSite.
Get-SPOSite -Template REDIRECTSITE#0
will probably show you the redirect, unfortunately I only tried this after I'd already deleted it.
https://docs.microsoft.com/en-us/sharepoint/manage-site-redirects
The command
Remove-AzureADMSDeletedDirectoryObject - to purge a Deleted Group
may also be useful to others who find this thread as it's good to delete the sharepoint and the group before re-creating