Microsoft teams size

HASSAN BIN NASIR DAR 391 Reputation points
2022-09-16T00:05:31.52+00:00

Hi

I have more than 300 microsoft teams. I want to know the size of all teams (I mean, individually teams size). Is there any powershell command?

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
Microsoft Teams Microsoft Teams for business Other
{count} votes

3 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-09-19T05:30:17.887+00:00

    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.


    2 people found this answer helpful.

  2. Filip Neshev 1 Reputation point
    2022-09-16T02:35:02.96+00:00

    First run:
    $Teamsgroups = Get-UnifiedGroup -Filter "ResourceProvisioningOptions -eq 'Team' "
    to find all existing Teams.

    Next run:
    $Teamsgroups | select DisplayName, @{L=’Number of Members’; E={ ( Get-TeamUser -GroupId $_.ExternalDirectoryObjectId ).count } }

    Prerequisites:

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn ( for Get-UnifiedGroup )
    Install module MicrosoftTeams ( for Get-TeamUser )


  3. HASSAN BIN NASIR DAR 391 Reputation points
    2022-09-16T10:42:14.577+00:00

    Hi,

    I am going to migrate my all Microsoft teams sites from one Microsoft 365 tenant to other 365 tenant. I want to know the size of all teams sites because I want to calculate estimate time how long time my migration software will take.

    Regards

    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.