backupgap

Get your real sizes with PowerShell

Before you can budget for backup you need actual numbers. The admin centre reports leave out archives and recycle bins, which are exactly the parts that inflate the bill. These scripts get you the measured values. No signup, no email.

Mailbox and archive sizes

Requires the ExchangeOnlineManagement module.

Install-Module ExchangeOnlineManagement -Scope CurrentUser
Connect-ExchangeOnline

Get-EXOMailbox -ResultSize Unlimited -PropertySets Archive |
  ForEach-Object {
    $primary = Get-EXOMailboxStatistics -Identity $_.UserPrincipalName
    $archive = $null
    if ($_.ArchiveStatus -eq 'Active') {
      $archive = Get-EXOMailboxStatistics -Identity $_.UserPrincipalName -Archive
    }
    [pscustomobject]@{
      User        = $_.UserPrincipalName
      Type        = $_.RecipientTypeDetails
      PrimaryGB   = [math]::Round($primary.TotalItemSize.Value.ToBytes() / 1GB, 2)
      ArchiveGB   = if ($archive) { [math]::Round($archive.TotalItemSize.Value.ToBytes() / 1GB, 2) } else { 0 }
      DeletedGB   = [math]::Round($primary.TotalDeletedItemSize.Value.ToBytes() / 1GB, 2)
    }
  } | Export-Csv .\mailbox-sizes.csv -NoTypeInformation

Note the DeletedGB column. That's recoverable-items content, and it's billable under native backup. Most sizing exercises forget it.

Shared mailboxes specifically

Shared mailboxes are frequently unlicensed and frequently left out of backup scope. Count them separately.

Get-EXOMailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited |
  Measure-Object | Select-Object Count

SharePoint and OneDrive site sizes

Requires the Microsoft.Online.SharePoint.PowerShell module.

Connect-SPOService -Url https://YOURTENANT-admin.sharepoint.com

Get-SPOSite -Limit All -IncludePersonalSite $true |
  Select-Object Url, Owner, Template,
    @{n='StorageGB'; e={[math]::Round($_.StorageUsageCurrent / 1024, 2)}},
    LastContentModifiedDate |
  Sort-Object StorageGB -Descending |
  Export-Csv .\site-sizes.csv -NoTypeInformation

Sort by LastContentModifiedDate to find stale sites. Anything untouched for twelve months is a candidate to leave out of your backup policy, and in most tenants that's a large share of total storage.

Turning this into a number

Total the CSVs, add your version-history uplift to the SharePoint and OneDrive figures — mailboxes have no file versions — and multiply by the per-GB rate. Or paste the totals into the calculator, which does the arithmetic and shows you the scoped alternative alongside it.

Open the calculator

One warning about the reports

If your tenant has the admin centre privacy setting that conceals user information turned on, usage reports return anonymised names. The totals are still correct, but you won't be able to map sizes to specific users until an admin changes that setting.