SharePoint Online: PowerShell to List Deleted Sites
Requirement: Find All Deleted Site Collections in SharePoint Online
How to Get Deleted Sites in SharePoint Online?
Deleted site collection are sent to recycle bin in SharePoint Online and stays there for 92 days until they purged permanently. To check if a site collection is deleted and exists in recycle bin,
PowerShell to Get Deleted Site Collections in SharePoint Online:
Using SharePoint Online Management Shell, you can get a list of deleted site collections as:
This lists all deleted sites
PnP PowerShell Get Deleted Sites in SharePoint Online
Similarly, you can get all deleted sites from SharePoint Online tenant recycle bin using PnP PowerShell too. Here is the PnP PowerShell to list deleted sites in SharePoint Online:
How to check who deleted SharePoint Online site?
To find out who has deleted a SharePoint Online site collection, do the following:
How to Get Deleted Sites in SharePoint Online?
Deleted site collection are sent to recycle bin in SharePoint Online and stays there for 92 days until they purged permanently. To check if a site collection is deleted and exists in recycle bin,
- Login to SharePoint Online Admin Center >> Click on "Deleted Sites" link from left navigation (In classic Admin Center, Go to "Site Collections" link from the left navigation and click on "Recycle Bin" Icon)
PowerShell to Get Deleted Site Collections in SharePoint Online:
Using SharePoint Online Management Shell, you can get a list of deleted site collections as:
$AdminSiteURL = "https://crescenttech-admin.sharepoint.com" #Connect to SharePoint Online Connect-SPOService -URL $AdminSiteURL -Credential (Get-Credential) #Get all Deleted Sites Get-SPODeletedSite
This lists all deleted sites
PnP PowerShell Get Deleted Sites in SharePoint Online
Similarly, you can get all deleted sites from SharePoint Online tenant recycle bin using PnP PowerShell too. Here is the PnP PowerShell to list deleted sites in SharePoint Online:
#Config Variables $TenantURL = "https://crescenttech-admin.sharepoint.com" #Connect to PnP Online Connect-PnPOnline -Url $TenantURL -Credentials (Get-Credential) #Get All Deleted Sites from Recycle Bin Get-PnPTenantRecycleBinItem
How to check who deleted SharePoint Online site?
To find out who has deleted a SharePoint Online site collection, do the following:
- Go to Office 365 Security & Compliance Center at https://protection.office.com/
- Expand Search >> Audit Log Search Select the Activities as "Deleted site" and set the date parameters accordingly and hit search.
- This will get you all sites deleted along with the user name who has deleted the site.
Hi,
ReplyDeleteBy chance can we get user name that who deleted?
Thanks,
Srini
Use Audit log search in Office 365 Security & Compliance Center!
Delete