Microsoft Teams PowerShell

Teams PowerShell Overview


 Microsoft Teams has a rich set of tools for IT admins to manage the product through the Microsoft Teams   admin center, PowerShell controls, and Graph APIs. This guide explains how we structure our PowerShell   cmdlets for IT admins to use, and provides pointers to further documentation. Note that different Teams   admin roles have access to different cmdlets. For more information, see Use Microsoft Teams admin roles to   manage Teams.

 Which modules do you need to use?

 The PowerShell controls for managing Teams are in two different PowerShell modules:
·         Microsoft Teams PowerShell module : The Teams PowerShell module contains all the cmdlets you need to create and manage teams.
·         Skype for Business PowerShell module: The Skype for Business PowerShell module contains the cmdlets to manage policies, configurations, and other Teams tools.

 Manual Package Download

 https://docs.microsoft.com/en-us/powershell/gallery/how-to/working-with-packages/manual-download

     Install-Module MicrosoftTeams
 Find the MicrosoftTeams PowerShell module from the PowerShell Gallery
  • Open Windows PowerShell.
  • Run the “Find-Module MicrosoftTeams” command
  • Find-Module MicrosoftTeams
  • Get-Module MicrosoftTeams –ListAvailable
  • Get-Command –Module MicrosoftTeams

         The following cmdlet references are for Microsoft Teams.

Cmdlet
Description
Connects an authenticated account to use for Microsoft Teams environment

Disconnects from the Microsoft Teams environment
Retrieves teams with particular properties or information
Gets all the channels for a team
Provides a list of commands for Microsoft Teams
Returns the users of a specific team
Provisions a new Team, or converts a group to a team
Adds a new channel to a team
Adds an owner or member to the team
Deletes a team
Deletes a channel
Removes an owner or member from a team
Updates properties of a team
Updates Team channel information
Adds an owner or member to the private channel.
Add-TeamChannelUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -DisplayName "Engineering" -User dmx@example.com
The `Add-TeamUser` adds an owner or member to the team, and to the unified group which backs the team.
Add-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User dmx@example.com
The Connect-MicrosoftTeams cmdlet connects an authenticated account to use for Microsoft Teams cmdlet requests.
Connect-MicrosoftTeams -TeamsEnvironmentName TeamsGCCH
Disconnects from the Microsoft Teams environment.
Disconnect-MicrosoftTeams
This cmdlet supports retrieving teams with particular properties/information, inclding all teams that a specific user belongs to, all teams that have been archived, all teams with a specific display name, or all teams in the organization.
Get-Team -User dmx1@example.com
Get-Team -Archived $true -Visibility Private
Get-Team -MailNickName "BusinessDevelopment"
Get all the channels for a team.
Get-TeamChannel -GroupId af55e84c-dc67-4e48-9005-86e0b07272f9
Returns users of a channel.
Get-TeamChannelUser -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf -DisplayName "Engineering" -Role Owner
Gets a team's fun settings. Get-TeamFunSettings -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf
Gets a list of commands for Microsoft Teams.
Get-TeamHelp []
This cmdlet supports retrieving all the policy packages available on a tenant.
Get-TeamPolicyPackage
Get-TeamPolicyPackage -Identity Education_PrimaryStudent
Returns users of a team.
Get-TeamUser -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf -Role Owner
This cmdlet supports retrieving the policy package that's assigned to a user.
Get-TeamUserPolicyPackage -Identity johndoe@example.com
This cmdlet supports retrieving recommendations for which policy packages are best suited for a given user.
Get-TeamUserPolicyPackageRecommendation -Identity johndoe@example.com
his cmdlet supports applying a policy package to users in a tenant.
Grant-TeamUserPolicyPackage -Identity 1bc0b35f-095a-4a37-a24c-c4b6049816ab,johndoe@example.com -PackageName Education_PrimaryStudent
This cmdlet lets you provision a new Team for use in Microsoft Teams and will create an O365 Unified Group to back the team. 
New-Team -DisplayName "Tech Reads"
New-Team -DisplayName "Tech Reads" -Description "Team to post technical articles and blogs" -Visibility Public
Add-TeamUser -GroupId $group.GroupId -User wilma@example.com
New-TeamChannel -GroupId $group.GroupId -DisplayName "Contracts"
Add a new channel to a team.
New-TeamChannel -GroupId 126b90a5-e65a-4fef-98e3-d9b49f4acf12 -DisplayName "Engineering" -MembershipType Private
This cmdlet deletes a specified Team from Microsoft Teams. 
Remove-Team -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df
Delete a channel. This will not delete content in associated tabs.
Remove-TeamChannel -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf -DisplayName "Tech Reads"
 the command will return immediately, but the Teams application will not reflect the update immediately, please refresh the members page to see the update. Note: last owner cannot be removed from the private channel.
Remove-TeamChannelUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -DisplayName "Engineering" -User dmx@example.com
Remove an owner or member from a team, and from the unified group which backs the team.
Remove-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User dmx@example.com
This cmdlet allows you to update properties of a team, including its displayname, description, and team-specific settings.
Set-Team -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf -DisplayName "Updated TeamName" -Visibility Public
Update Team channels settings.
Set-TeamChannel -GroupId c58566a6-4bb4-4221-98d4-47677dbdbef6 -CurrentDisplayName TechReads -NewDisplayName "Technical Reads"
Update the team picture. Note: the command will return immediately, but the Teams application will not reflect the update immediately. 
Note: this cmdlet is not support in special government environments (TeamsGCCH and TeamsDoD) and is currently only supported in our beta release.
Set-TeamPicture -GroupId 2f162b0e-36d2-4e15-8ba3-ba229cecdccf -ImagePath c:\Image\TeamPictire.png

Set-CsTeamsClientConfiguration


The TeamsClientConfiguration allows IT admins to control the settings that can be accessed via Teams clients across their organization. 
Set-CsTeamsClientConfiguration -Identity Global -AllowDropBox $false

Set-CsTeamsMeetingPolicy

The `CsTeamsMeetingPolicy` cmdlets enable administrators to control the type of meetings that users can create or the features that they can access while in a meeting.
Set-CsTeamsMeetingPolicy -Identity SalesMeetingPolicy -AllowTranscription $True

Set-CsTeamsCallingPolicy

Use this cmdlet to update values in existing Teams Calling Policies.
Set-CsTeamsCallingPolicy -Identity Global -AllowPrivateCalling $true

Set-CsTeamsMessagingPolicy

The CsTeamsMessagingPolicy cmdlets enable administrators to control if a user is enabled to exchange messages.
Set-CsTeamsMessagingPolicy -Identity StudentMessagingPolicy -AllowGiphy $false -AllowMemes $false
Get-CsTeamsMessagingPolicy | Set-CsTeamsMessagingPolicy -Identity StudentMessagingPolicy -AllowGiphy $false -AllowMemes $false



No comments:

Post a Comment