Saturday , September 5 2020

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 2.2.4.1

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

Choose The Task: 1

User SMTP Address Role Channel DisplayName Team DisplayName
—————– —- ——————- —————-
xx@azure365pro.com Owner General Teams_Azure365pro
xx01@azure365pro.com 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 –

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Power BI Data Gateway with Active Directory

You can create amazing reports with Active directory information with live refresh . It saves …

18 comments

  1. Hi

    I dont get the Get-TeamChannelUser cmlet available. How do I make it avaialble for the script to run?

  2. 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.

  3. why use Add-Member in the code?

  4. 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\1.0.0.1\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
    vider

    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\1.0.0.1\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
    ider

    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!

  5. I??™m absolutely sure : http://arthrosis.site

  6. Hi,

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

  7. 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).
    thanks

  8. 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.

Leave a Reply

Your email address will not be published.