Fix the Get-SPODeletedSite URL Error in SharePoint Online
Question details
The user needs to resolve a malformed site URL error when using SharePoint Online deleted-site PowerShell commands.

- Product
- SharePoint Online Management Shell
- Device & OS
- not provided
- Scenario
- An administrator is retrieving or removing a deleted SharePoint Online site collection with PowerShell.
- Observed behavior
- Get-SPODeletedSite or Remove-SPODeletedSite reports that the site is not properly formed when the site collection URL is incorrect or incomplete.
Make sure the SharePoint Online Management Shell is available and that you have an account with the necessary SharePoint administrator permissions. Identify your tenant name and the deleted site's expected path before connecting.
Verify and use the full deleted site collection URL
Use the exact URL returned by SharePoint to avoid passing an incomplete or incorrect site address to the commands.
Open the SharePoint Online Management Shell and run Connect-SPOService -Url "https://tenant-admin.sharepoint.com", replacing tenant with your tenant name. Sign in when prompted.
Run Get-SPODeletedSite to list deleted sites. Find the intended site and copy its full URL from the output.
Verify that the copied URL includes https://, the correct tenant, and the complete site path. Common examples are https://tenant.sharepoint.com/sites/site-name and https://tenant.sharepoint.com/teams/site-name.
Run Get-SPODeletedSite -Identity "https://tenant.sharepoint.com/sites/site-name", replacing the example with the exact URL you copied.
After confirming the returned site is correct, run Remove-SPODeletedSite -Identity "https://tenant.sharepoint.com/sites/site-name" only if you intend to permanently remove it, and follow the confirmation prompt.

Work with Office documents using WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Microsoft Office formats, making it easier to move existing documents into your workflow. It does not manage SharePoint Online sites or fix SharePoint PowerShell errors.

Frequently Asked Questions
Which URL should I use with Get-SPODeletedSite?
Use the full deleted site collection URL, such as https://tenant.sharepoint.com/sites/site-name. Run Get-SPODeletedSite without an identity to find and copy the URL returned for the site.
Should I use the SharePoint admin URL as the site identity?
No. Use https://tenant-admin.sharepoint.com with Connect-SPOService, then use the deleted site's own URL with the -Identity parameter of Get-SPODeletedSite or Remove-SPODeletedSite.
Does Remove-SPODeletedSite permanently delete the site?
Yes. Remove-SPODeletedSite permanently removes the deleted site collection. First use Get-SPODeletedSite -Identity with the full URL to confirm you have selected the intended site.
What if SharePoint displays different capitalization in the site URL?
The reported capitalization may differ from what you entered without affecting functionality. Use the exact URL returned by Get-SPODeletedSite when querying or removing the deleted site; changing letter case is not a substitute for verifying the tenant and full path.




