PowerShell for retrieving actual size of deleted SharePoint Online sites

lilyvalley-8419 220 Reputation points
2025-01-30T01:50:58.6+00:00

I'm looking to automate the retrieval of the actual size of deleted sites.

Currently, I'm using the command Get-SPODeletedSite -Limit All, which provides the Resource Quota, but this value does not reflect the actual size of the site.

Is there a way to obtain the real size of deleted sites, as it appears when viewing them in the deleted sites section?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,309 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 50,326 Reputation points Microsoft Vendor
    2025-01-30T07:27:13.9333333+00:00

    Unfortunately, Get-SPODeletedSite -Limit All doesn't provide the actual storage size of the deleted sites. It only shows the resource quota, which is more about the space allocated for the site rather than its actual usage. As you mentioned, this value doesn't reflect the real size of the site, especially for deleted sites.

    As of now, there isn't a direct PowerShell command available to retrieve the actual size of a deleted site.

    You could go to SharePoint admin center -> Sites -> Deleted sites -> Check used storage of deleted site collection.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Zafer KAYA 90 Reputation points MVP
    2025-01-30T06:50:43.36+00:00

    Get-SPODeletedSite -Limit All

    Retrieve Site Size from the SharePoint Online Management Shell (Post-Restore): Unfortunately, there is no direct method for getting the size of a deleted site through PowerShell until it’s restored, as SharePoint Online does not expose this detail for deleted sites. The site’s storage quota is also not reliable for determining the actual size because it is not updated in real time.

    To restore the site and then check its size (after it's been restored): Restore-SPODeletedSite -Identity "https://yourdomain.sharepoint.com/sites/sitename"

    Get-SPOSite -Identity "https://yourdomain.sharepoint.com/sites/sitename" | Select-Object URL, StorageUsageCurrent


  2. Zafer KAYA 90 Reputation points MVP
    2025-01-30T06:51:17.9933333+00:00

    Alternative: Manual Approach for Checking Deleted Site Size

    While the site is still deleted, you can use the SharePoint Admin Center to check the actual size of deleted sites:

    1. Go to the SharePoint Admin Center.
    2. Under Sites, click on Deleted Sites.
    3. Find the site you're interested in and check its size (it will show under the Storage Usage column).
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.