Commands › SharePoint Online

Get-SPODeletedSite

SharePoint Online Microsoft.Online.SharePoint.PowerShell Get-*

Returns all deleted site collections from the Recycle Bin.

Quick start script

# Get-SPODeletedSite — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Run and inspect
Get-SPODeletedSite -IncludeOnlyPersonalSite <SwitchParameter> | Format-List

# 3. Export for evidence / drift tracking
Get-SPODeletedSite | Export-Clixml .\SPODeletedSite-$(Get-Date -Format yyyyMMdd).xml

Syntax — 2 parameter sets

ParameterSetAllSites (Default)

Get-SPODeletedSite [[-Identity] <SpoSitePipeBind>] [-Limit <String>] [-IncludePersonalSite]
 [<CommonParameters>]

ParameterSetPersonalSitesOnly

Get-SPODeletedSite [[-Identity] <SpoSitePipeBind>] [-Limit <String>] [-IncludeOnlyPersonalSite]
 [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Identity SpoSitePipeBind Specifies the URL of the deleted site collection to be returned.
-IncludeOnlyPersonalSite SwitchParameter yes Use this switch parameter to only include Personal Sites in the returned results.
-IncludePersonalSite SwitchParameter Use this switch parameter to include Personal Sites with the returned results.
-Limit String Specifies the maximum number of site collections to return. It can be any number. To retrieve all site collections, use ALL. The default value is 200.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.