Saturday, November 15, 2025

To View Deleted Site Collections #PowerShell


 To View Deleted Site Collections #PowerShell

===================================

Returns all deleted site collections from the Recycle Bin.

Syntax

ParameterSetAllSites (Default)

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

Description

The Get-SPODeletedSite cmdlet returns all deleted site collections that match the given criteria from the Recycle Bin.

By default the cmdlet only returns site and site collections that are not Personal Sites (My Sites). To include personal sites, use the IncludePersonalSite parameter. To return only Personal Sites, use the IncludeOnlyPersonalSite parameter.

These two Switch Parameters are in different parameter sets, so you can only use either one of them but not both.

This action does not restore these returned sites or site collection. It only returns their properties so that you can see what sites or site collections have been deleted. To restore the site or site collections, forward the results to the Restore-SPODeletedSite cmdlet in the pipeline.

You must be a SharePoint Online administrator and be a site collection administrator for the deleted site collections to run the cmdlet.

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell.

Example 1

PowerShell
Get-SPODeletedSite -IncludePersonalSite

The command in this example returns all deleted site collections from the Recycle Bin including Personal Sites.


Restore Command: 

Restore-SPODeletedSite -Identity <SiteCollectionURL>




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.