Last active
April 6, 2021 20:26
-
-
Save mirontoli/edf2a63f1190067b09a963676052317f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# it calculates storage capacity in SharePoint Online | |
# read more on my blog post: https://chuvash.eu/?p=5360 | |
$sku = Get-MsolAccountSku | |
$sku2 = $sku | % { | |
$s = $_; | |
$sr = [PSCustomObject]@{ | |
SkuPartNumber = $s.SkuPartNumber; | |
Licenses = $s.ActiveUnits + $s.WarningUnits | |
Services = $s.ServiceStatus | % { $_.ServicePlan.ServiceName }; | |
}; | |
$sr | |
} | |
$sta = $sku2 | ? { $_.Services.Contains("SHAREPOINTSTANDARD") } | |
$ent = $sku2 | ? { $_.Services.Contains("SHAREPOINTENTERPRISE") } | |
$odb = $sku2 | ? { $_.Services.Contains("ONEDRIVE_BASIC") } | |
$sta_count = $sta | Measure-Object -Sum Licenses | Select -ExpandProperty Sum | |
$ent_count = $ent | Measure-Object -Sum Licenses | Select -ExpandProperty Sum | |
$odb_count = $odb | Measure-Object -Sum Licenses | Select -ExpandProperty Sum | |
$def = 1024 | |
$stor_gb = $def + $sta_count*10 + $ent_count*10 + $odb_count*0.5 | |
$stor_tb = $stor_gb / 1024 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment