Hi @HASSAN BIN NASIR DAR
We can use the SharePoint Online Powershell cmdlet Get-SPOSite to get current site storage size and storage quota. Before proceeding, run the following command to connect Sharepoint Online Powershell module.
Connect-SPOService -Url https://<tanentname>-admin.sharepoint.com -Credential ******@o365domain.com
Now run the below script after replacing the <tanentname> and <group-name> with your own tenant name and group name.
$O365GroupSiteUrl ="https://<tanentname>.sharepoint.com/sites/<group-name>"
$O365GroupSite = Get-SPOSite -Identity $O365GroupSiteUrl
$StorageSize =$O365GroupSite.StorageUsageCurrent
Write-Host "Storage used (MB): " $StorageSize " MB" -ForegroundColor Yellow
Write-Host "Storage used (GB): " ($StorageSize/1024) " GB" -ForegroundColor Yellow
Get the current Storage Size for all Office 365 Groups:
$userName ="admin@<tanentname>.onmicrosoft.com"
$o365Cred = Get-Credential -UserName $userName -Message "Enter Office 365 Admin Credentials"
$o365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $o365Cred -Authentication Basic -AllowRedirection
Import-PSSession $o365Session
$spoAdminUrl ="https://<tanentname>-admin.sharepoint.com/"
Connect-SPOService -Url $spoAdminUrl -Credential $o365Cred
$O365Groups = Get-UnifiedGroup -ResultSize Unlimited
$CustomResult=@()
ForEach ($O365Group in $O365Groups){
If($O365Group.SharePointSiteUrl -ne $null) { $O365GroupSite=Get-SPOSite -Identity $O365Group.SharePointSiteUrl
$CustomResult += [PSCustomObject] @{
GroupName = $O365Group.DisplayName
SiteUrl = $O365GroupSite.Url
StorageUsed_inMB = $O365GroupSite.StorageUsageCurrent
StorageQuota_inGB = $O365GroupSite.StorageQuota/1024
WarningSize_inGB = $O365GroupSite.StorageQuotaWarningLevel/1024
}
}}
$CustomResult | FT
You can also export the output into CSV file:
$CustomResult | Export-CSV "C:\\O365-Group-Storage-Info.csv" -NoTypeInformation -Encoding UTF8
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.