How to export teams and channels data size via PowerShell , is there any script or any option for the same?
How to export teams and channels data size via PowerShell , is there any script or any option for the same?
Do you mean you want to export the number of Teams channel in your organization via PowerShell?
Our forum is mainly focused on the general issue of Microsoft Teams troubleshooting. According to your description, your issue is more related to PowerShell script development, which is not in our support scope. The following script is just for your reference:

Then copy this script and all channel information will be found in your local file.
$AllTeamsInOrg = (Get-Team).GroupID
$TeamList = @()
Write-Output "This may take a little bit of time... Please sit back, relax and enjoy some GIFs inside of Teams!"
Write-Host ""
Foreach ($Team in $AllTeamsInOrg)
{
$TeamGUID = $Team.ToString()
$TeamGroup = Get-UnifiedGroup -identity $Team.ToString()
$TeamName = (Get-Team | ?{$_.GroupID -eq $Team}).DisplayName
$TeamOwner = (Get-TeamUser -GroupId $Team | ?{$_.Role -eq 'Owner'}).User
$TeamUserCount = ((Get-TeamUser -GroupId $Team).UserID).Count
$TeamGuest = (Get-UnifiedGroupLinks -LinkType Members -identity $Team | ?{$_.Name -match "#EXT#"}).Name
if ($TeamGuest -eq $null)
{
$TeamGuest = "No Guests in Team"
}
$TeamChannels = (Get-TeamChannel -GroupId $Team).DisplayName
$ChannelCount = (Get-TeamChannel -GroupId $Team).ID.Count
$TeamList = $TeamList + [PSCustomObject]@{TeamName = $TeamName; TeamObjectID = $TeamGUID; TeamOwners = $TeamOwner -join ', '; TeamMemberCount = $TeamUserCount; NoOfChannels = $ChannelCount; ChannelNames = $TeamChannels -join ', '; SharePointSite = $TeamGroup.SharePointSiteURL; AccessType = $TeamGroup.AccessType; TeamGuests = $TeamGuest -join ','}
}
#######
$TestPath = test-path -path 'c:\temp'
if ($TestPath -ne $true) {New-Item -ItemType directory -Path 'c:\temp' | Out-Null
write-Host 'Creating directory to write file to c:\temp. Your file is uploaded as TeamsDatav2.csv'}
else {Write-Host "Your file has been uploaded to c:\temp as 'TeamsDatav2.csv'"}
$TeamList | export-csv c:\temp\TeamsDatav2.csv -NoTypeInformation
Here is our test result about this script:


If the response is helpful, please click "Accept Answer" and upvote it.
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.
Hi @SharonZhao-MSFT , I mean to say , data which users have shared files and documents in chats and meetings and channels. is there any option or how we can get it via PowerShell?
9 people are following this question.