Microsoft Teams PowerShell Module General Availability
Published Apr 24 2019 09:00 AM 63.8K Views

We are excited to announce the general availability of the Microsoft Teams PowerShell module. This PowerShell module, first released in Beta last year, allows you to manage the lifecycle of teams within your organization. As a Global Administrator or Teams Service Administrator, you can identify and manage teams on behalf of your users, and make bulk updates to teams faster – including changing memberships or managing team settings. This new version of our module leverages only 1.0 Graph APIs.

 

Going forward, we will be maintaining both a Preview and Generally Available versions of the Microsoft Teams PowerShell module. This will allow us to deliver new, preview functionality to our customers faster for testing, while ensuring that our Generally Available module continues to leverage only 1.0 APIs.

 

The following cmdlets are supported in our generally available module:

Cmdlet

Description

Connect-MicrosoftTeams

Connects an authenticated account to use for Microsoft Teams environment

Disconnect-MicrosoftTeams

Disconnects from the Microsoft Teams environment

Get-Team

Retrieves teams with particular properties or information

Get-TeamChannel

Gets all the channels for a team

Get-TeamHelp

Provides a list of commands for Microsoft Teams

Get-TeamUser

Returns the users of a specific team

New-Team

Provisions a new Team, or converts a group to a team

New-TeamChannel

Adds a new channel to a team

Add-TeamUser

Adds an owner or member to the team

Remove-Team

Deletes a team

Remove-TeamChannel

Deletes a channel

Remove-TeamUser

Removes an owner or member from a team

Set-Team

Updates properties of a team

Set-TeamChannel

Updates Team channel information

 

Additional Functionality in New Release
In addition to leveraging solely 1.0 APIs, we have made a few improvements to cmdlets in the Generally Available module:

 

Connect-MicrosoftTeams: You can now specify a Teams Government Environment (-TeamsEnvironmentName) that your organization is homed in.

 

Get-Team: We expanded the filter and selection criteria to include properties such as the Visibility or Archived state of the teams so that you can more easily identify teams that may require your attention

Simplified Experience
To improve the discoverability of certain team settings, we consolidated the functionality of the following cmdlets into the Get-Team and Set-Team cmdlets:

 

- Get-TeamFunSettings
- Get-TeamGuestSettings
- Get-TeamMemberSettings
- Get-TeamMessagingSettings
- Set-TeamFunSettings
- Set-TeamGuestSettings
- Set-TeamMemberSettings
- Set-TeamMessagingSettings

 

Note: These beta cmdlets will not be available in future module releases

 

Want to learn more about PowerShell?
Because Teams is built on top of different services, PowerShell controls for Teams are split across several modules. Learn more about PowerShell for Teams (also includes links to the technical docs for individual cmdlets).

 

Let us know what you think!
If you have suggestions on how to make Teams better, please submit your idea via User Voice or vote for existing ideas to help us prioritize the requests. We read every piece of feedback that we receive to make sure that Microsoft Teams meets your needs.
Christopher Bryan, Microsoft Teams

25 Comments
Deleted
Not applicable

Great news!

Copper Contributor
Excellent news !
Silver Contributor

please make sure that this gets posted to the O365 Admin Center Message page

Just installed GA version of the MicrosoftTeams #PowerShell module. Connect-MicrosoftTeams command worked as expected. The next one, Get-Team, failed with the error message "Unsupported token. Unable to initialize the authorization context." :( Using -Verbose or -Debug doesn't provide any additional information useful for a troubleshooting.

Iron Contributor

awesome - thanks! 

Copper Contributor

Be sure to check out the DSC resources as well!  

https://github.com/Microsoft/Office365DSC

 

Copper Contributor

Very helpful and great thanks. I have tried both 0.9.6 and 1.0.0 and got one question.

When adding owner using Add-TeamUser like:  Add-TeamUser  -GroupId <GroupID> -User <UserEmail> -Role Owner then check its status in Office365 group, I found the identified user is just shown as O365 group owner and have no member permission. So each time I have to run command twice, one for -role owner and one for -role member to ensure this user can use every function in Teams.

Do you intentionally design the command like this? 

 

Meanwhile, the owner identified in New-Team like:  New-Team -DisplayName <TeamName> -Owner <UserEmail> -Visibility Private can be found as both owner and member in office365 group.

 

 

 

Iron Contributor

Great Thanks

This is really great news!

Copper Contributor

@Aleksandar Nikolic I experienced the same, restarting the PowerShell helped me fix the issue.

Get-Team with 1.0 moduleGet-Team with 1.0 module

Iron Contributor

I wish Get-Team returned the URL for the team.  That would make our lives a lot easier.

Copper Contributor

I agree with you Alex, instead of providing the Group ID, if it returns the Team Site URL or both would be really helpful.

Copper Contributor

Excellent news, just one thing which would be a really nice to have would be to change the group a Team is attached to, is this something on the Roadmap?

Copper Contributor

How can i get the GuestSettings now?

Copper Contributor

I'm finding it impossible to report on which Teams have guests in the new module and the table in the Admin Center isn't sortable or filterable. I need to keep an eye on guest access but I'm also not trained in PowerShell and one of those saps who has to google everything and snag others' scripts. I found one but it times out before it finishes so I'm not even sure if it works or not. I don't even really need to know who the guests are, I just need to say to Team owners "Hey, you have external guests in your Team. Please make sure these are valid guests and remove access as needed." etc., etc.

Copper Contributor
Go into the Teams Admin Center. Click on Teams. The landing page lists all teams and the number of guest users in each team.
Silver Contributor

@Aashe4one easy way to do that is with the Access Review feature in Azure AD, it is specifically designed for that purpose. see https://docs.microsoft.com/en-us/azure/active-directory/governance/access-reviews-overview

Iron Contributor

Could somebody tell me what the alternative is for the 'Set-TeamPicture' cmdlet, becuase it seems to be gone...

How can I set a logo for a team now?

Brass Contributor

I appreciate that we now have this module. However...

 

  • why is this hosted on PowerShellGallery? Microsoft specifically says that scripts in the PSG are not supported and no warranty is given. And I really don't like when necessary tools are published at a place, where there is no support nor warranty.
  • I dislike that the Powershell modules for managing Office 365 are all over the place. Why is there not a single 'hub' where I can get all the modules from, that I need to manage Office 365? Can you please communicate better with your colleagues, instead of everyone doing his own thing? This pisses me off!
Copper Contributor

We use the powershell modulets from SharePoint, Groups and Teams a lot as the backbone in our provisioning tool an the GA of Teams powershell was a major event for us. However in order to complete the governance module we have to archive Teams, and am very surprised that this can be done in the GUI and not in powershell. Any eta for this? 

Copper Contributor
Copper Contributor

The biggest issue I have is the lack of support for the pre-canned templates available to the GUI. Being an educational institution, we regularly provision Teams (about 200 per semester with up to 150 members in each) based on the class template so manual provisioning is not exactly an option.

The template option was available in the last beta (0.9.6) which I have had to roll back to. Still getting my head around the Graph API but there doesn't appear to be an option in the create team call for templates unless we create a blank team based on the pre-canned template and then clone that but that seems to be re-inventing the wheel given that what I need already exists

Copper Contributor

I downloaded the latest version and attempted to connect but go this error: 

 

Connect-MicrosoftTeams : Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot
find the file specified.
At line:1 char:1

 

What am I doing wrong? Any advice would be appreciated.

Deleted
Not applicable

@Maha Elkoshairi Same issue here - Solution for me was to install Visual Studio.

All my Googling kept turning up mentions of Package Managers, NuGet, etc, and Visual Studio.

 

Not an expert in there area but this is how I got it working:

Installed VS, checked off anything related to .NET

Ran PowerShell for Developer

Did a Find-Module and select yes to install the NuGet package.

Then in PowerShell as admin, ran Connect-MicrosoftTeams and I was in.

 

 

 

 

Copper Contributor

@Deleted This worked for me too. Thanks

Version history
Last update:
‎Jan 26 2021 01:15 PM
Updated by: