37 C
Monday, July 22, 2024

Export all Teams Channels and all members in Office 365

In some situations like if we wish to study a new environment or restructure a existing environment or check user teams channels membership across the tenant. we have to Export all the Teams Channels and all the members of it to a CSV file. There is no command let available to retrieve the Teams and Channel members in bulk. Pipe line won’t work in this case. Its very similar to Distribution Group and its members like in Exchange online.Which i wrote a script many years back.

Lets see how to do similar stuff in Microsoft Teams PowerShell native module. if you want to know how to install latest repositories and

PLEASE NOTE YOU HAVE TO USE PRE RELEASE version for the script to work which is covered in below article. Get-TeamChannelUser doesn’t work on Production PowerShell Respository.

Install-Module PowerShellGet -RequiredVersion

To use pre-release version – (Get-TeamChannelUser is available only on pre release version for now)

Install-Module -Name MicrosoftTeams -RequiredVersion 1.1.3-preview -AllowPrerelease

Connect to Microsoft Teams Powershell i have covered in this article.

Download the Script

Choose the Task 1 to Export the minimal data and display in shell.

PS C:\Scripts> .\TeamsChannelMemberReport.ps1

Teams Channel Member Report

1.Display in Microsoft Teams Shell

2.Export to CSV File

3.Display Specific Microsoft Team in Shell
4.Export Specific Microsoft Team to CSV File

Choose The Task: 1

User SMTP Address Role Channel DisplayName Team DisplayName
—————– —- ——————- —————-
xx@localhost Owner General Teams_Azure365pro
xx01@localhost Member General Teams_Azure365pro

Download the Script

Choose the Task 2 to Export the all the Teams Channels Membership data with Teams settings to a CSV File.

PS C:\Scripts> .\TeamsChannelMemberReport.ps1

Teams Channel Member Report

1.Display in Microsoft Teams Shell

2.Export to CSV File

Choose The Task: 2
Enter the Path of CSV file (Eg. C:\Teams.csv): c:\Scripts\Teams.csv

CSV Will Export Below Columns

  • DisplayName
  • UserId
  • User SMTP Address
  • Role
  • Channel DisplayName
  • Channel Description
  • Channel MembershipType
  • Team GroupID
  • Team DisplayName
  • Team Description
  • Team Visibility
  • Team MailNickName
  • Team Classification
  • Team Archived
  • Team AllowGiphy
  • Team GiphyContentRating
  • Team AllowStickersAndMemes
  • Team AllowGuestCreateUpdateChannels
  • Team AllowGuestDeleteChannels
  • Team AllowCreateUpdateChannels
  • Team AllowCreatePrivateChannels
  • Team AllowDeleteChannels
  • Team AllowAddRemoveApps
  • Team AllowCreateUpdateRemoveTabs
  • Team AllowCreateUpdateRemoveConnectors
  • Team AllowUserEditMessages
  • Team AllowUserDeleteMessages
  • Team AllowOwnerDeleteMessages
  • Team AllowTeamMentions
  • Team AllowChannelMentions
  • Team ShowInTeamsSearchAndSuggestions

CSV File will look like –

Git Public Repository Link –

azure365pro/DistributionGroupMemberReport (github.com)

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles


  1. I also got the error with missing ‘Get-TeamChannelUser’ command. I followed the guide to install this but still got the error. It’s worth mentoning that you have to may close PS and reconnect to Teams. The new module should then recognize the Get-TeamChannelUser as a valid command.

  2. I keep running into this error (Running powershell as admin)
    WARNING: Unable to download from URI ‘https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409’ to ”.
    WARNING: Unable to download the list of available providers. Check your internet connection.
    PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
    ‘NuGet’. The package provider requires ‘PackageManagement’ and ‘Provider’ tags. Please check if the specified package
    has the tags.
    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\\PSModule.psm1:7468 char:21
    + … $null = PackageManagement\Install-PackageProvider -Name $script:N …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (Microsoft.Power…PackageProvider:InstallPackageProvider) [Install-Pac
    kageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro

    PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name
    ‘NuGet’. Try ‘Get-PackageProvider -ListAvailable’ to see if the provider exists on the system.
    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\\PSModule.psm1:7474 char:21
    + … $null = PackageManagement\Import-PackageProvider -Name $script:Nu …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv

    I am fairly new to powershell, and this article would be extremely helpful for a project I am working on, any help is greatly appreciated!

  3. Hi,

    I tried all cmdlet for pre-release, it is still not working. Get-TeamChannelUser is not working. Is there any workaround?

  4. HI,
    Thanks for this article.
    what do we need to change in case if we need channels and their members’ list for only one of the team (not all teams).

  5. Hello

    I am still running into issues with this, and would appreciate some feedback:

    Specifically, when running the following:
    Install-Module -Name MicrosoftTeams -RequiredVersion 1.1.3-preview -AllowPrerelease

    I get the following to return:
    A potential parameter cannot be found that accepts argument ‘requireversion’. Cannot convert value “1.1.3-preview” to type “System.Version”. Error: “Input string was not in a correct format”.

    I even typed this command manually (checked to made sure i had no typos) and I still get this error.

    • Update:
      I was able to get the pre-release version to install finally. However, I followed the step to do the following so that Get-TeamChannelUser cmdet would work, but it still fails when I run the script. I closed powershell window after I installed it, and opened a new one. I then connected to Teams with Connect-MicrosoftTeams. I tested Get-Teams and it showed me a list of all the teams. Thought, great, it will work now. Ran the script again, and it still won’t recognize Get-TeamCahnnelUser and fails.

      Anything I can do to correct this issue?

      • Figured this out…

        I ran the cmdlet to try and see what module were installed. Even though I installed the pre release version and it went through with no errors, the production version of teams module was installed.

        I uninstalled that module, then reran the check module cmdlet. It was showing the prerelease version, but to be safe I uninstalled that. Re ran the steps to install the pre release version and checked to make sure it was the only one listed.

        It was, so I ran the script again, and this time it actually generated the CSV file with NO failures!!! Wish I would have figured this out sooner… took me switching to a different computer and a few weeks of attempts to try and figure out why it wasn’t working(Again, as stated above, I am a powershell newbie).

        Thanks for putting this together, and can confirm as of 9/2/2020 this script works.

  6. Hi,

    I’m running the script but its only exporting details for teams I have in my actual teams application.

    I have global admin and teams admin for my tenant, how can I get this to export all teams?


  7. Office 365 tenant to tenant migration. I’ve successfully exported all my teams, channels, and members from the source. Now I need to import that list into another Office 365 organization just changing the domain. Do you have a script to do this?

  8. Thank you very much!
    Works perfect – just use the actual preview Version

    “Install-Module MicrosoftTeams -AllowPrerelease -RequiredVersion “1.1.9-preview”

  9. Getting this error. Went thru comments and still not sure how to handle this

    Get-TeamChannelUser : You must call the Connect-MicrosoftTeams cmdlet before calling any other cmdlets.

    Please help

  10. also getting this

    Get-Team : You must call the Connect-MicrosoftTeams cmdlet before calling any other cmdlets.

    I have connected to microsoft teams as you explained earlier…

    I have used your script successfully at the beginning of the year but its not working now. Can you help?


Please enter your comment!
Please enter your name here

× How can I help you?