MicrosoftTeamsPowerShell

The following cmdlet references are for Microsoft Teams.

MicrosoftTeamsPowerShell

Add-TeamChannelUser

Adds an owner or member to the private channel.

Note: the command will return immediately, but the Teams application will not reflect the update immediately, please refresh the members page to see the update.

To turn an existing Member into an Owner, first Add-TeamChannelUser -User foo to add them to the members list, then Add-TeamChannelUser -User foo -Role Owner to add them to owner list.

Add-TeamsAppInstallation

Add a Teams App to Microsoft Teams.

Add-TeamUser

The Add-TeamUser adds an owner or member to the team, and to the unified group which backs the team.

Clear-CsOnlineTelephoneNumberOrder

Use the Clear-CsOnlineTelephoneNumberOrder cmdlet to cancel a specific telephone number search order and release the telephone numbers. The telephone numbers can then be available for search and acquire.

Clear-TeamsEnvironmentConfig

Clears environment-specific configurations from the local machine set by running Set-TeamsEnvironmentConfig.

Complete-CsOnlineTelephoneNumberOrder

Use the Complete-CsOnlineTelephoneNumberOrder cmdlet to complete a specific telephone number search order and confirm the purchase of the new telephone numbers. The telephone numbers can then be used to set up calling features for users and services in your organization.

Connect-MicrosoftTeams

The Connect-MicrosoftTeams cmdlet connects an authenticated account for use with cmdlets from the MicrosoftTeams module.

Disable-CsTeamsShiftsConnectionErrorReport

Note: This cmdlet is currently in public preview.

This cmdlet disables an error report.

Disconnect-MicrosoftTeams
Get-AssociatedTeam

This cmdlet supports retrieving all teams associated with a user, including teams which host shared channels.

Get-CsBatchPolicyAssignmentOperation

This cmdlet is used to retrieve the status of batch policy assignment operations.

Get-CsBatchTeamsDeploymentStatus

This cmdlet is used to get the status of the batch deployment orchestration.

Get-CsCloudCallDataConnection

This cmdlet retrieves an already existing online call data connection.

Get-CsGroupPolicyAssignment

This cmdlet is used to return group policy assignments.

Get-CsHybridTelephoneNumber

This cmdlet displays information about one or more hybrid telephone numbers.

Get-CsOnlineTelephoneNumberCountry

Use the Get-CsOnlineTelephoneNumberCountry cmdlet to get the list of supported countries to search and acquire new telephone numbers. The telephone numbers can then be used to set up calling features for users and services in your organization.

Get-CsOnlineTelephoneNumberOrder

Use the Get-CsOnlineTelephoneNumberOrder cmdlet to get the order report of a specific telephone number search order. The telephone numbers can then be used to set up calling features for users and services in your organization.

Get-CsOnlineTelephoneNumberType

Use the Get-CsOnlineTelephoneNumberType cmdlet to get the list of supported telephone number offerings in a given country. The telephone numbers can then be used to set up calling features for users and services in your organization.

Get-CsPhoneNumberAssignment

This cmdlet displays information about one or more phone numbers.

Get-CsPolicyPackage

This cmdlet supports retrieving all the policy packages available on a tenant.

Get-CsTeamsAcsFederationConfiguration

Limited Preview: Functionality described in this document is currently in limited preview and only authorized organizations have access. This preview version is provided without a service-level agreement, and is not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

This cmdlet is used to retrieve the federation configuration between Teams and Azure Communication Services. For more information, refer to Azure Communication Services and Teams Interoperability.

Get-CsTeamsEducationConfiguration

This cmdlet is used to retrieve the organization-wide education configuration for Teams.

Get-CsTeamsEnhancedEncryptionPolicy

Returns information about the teams enhanced encryption policies configured for use in your organization.

Get-CsTeamsEventsPolicy

Returns information about the Teams Events policy. Note that this policy is currently still in preview.

Get-CsTeamsMediaLoggingPolicy

Returns information about the Teams Media Logging policy.

Get-CsTeamsShiftsConnection

This cmdlet returns the list of existing workforce management (WFM) connections. It can also return the configuration details for a given WFM connection.

Get-CsTeamsShiftsConnectionConnector

This cmdlet supports retrieving the available Shifts Connectors.

Get-CsTeamsShiftsConnectionErrorReport

This cmdlet returns the list of all the team mapping error reports. It can also return the configuration details of one mapping error report with its ID provided or other filter parameters.

Get-CsTeamsShiftsConnectionInstance

This cmdlet returns the list of existing connection instances. It can also return the configuration details for a given connection instance.

Get-CsTeamsShiftsConnectionOperation

This cmdlet gets the requested batch mapping operation. The batch mapping operation can be submitted by running New-CsTeamsShiftsConnectionBatchTeamMap.

Get-CsTeamsShiftsConnectionSyncResult

This cmdlet supports retrieving the list of user details in the mapped teams of last sync.

Get-CsTeamsShiftsConnectionTeamMap

This cmdlet supports retrieving the list of team mappings.

Get-CsTeamsShiftsConnectionWfmTeam

This cmdlet supports retrieving the list of available Workforce management (WFM) teams in the connection instance.

Get-CsTeamsShiftsConnectionWfmUser

This cmdlet shows the list of Workforce management (WFM) users in a specified WFM team.

Get-CsTeamsShiftsPolicy

This cmdlet allows you to get properties of a TeamsShiftPolicy instance, including user's Teams off shift warning message-specific settings.

Get-CsTeamsUnassignedNumberTreatment

Displays a specific or all treatments for how calls to an unassigned number range should be routed.

Get-CsTeamsVoiceApplicationsPolicy

Use the Get-CsTeamsVoiceApplicationsPolicy cmdlet to get Teams voice applications policy information. TeamsVoiceApplications policy governs what permissions the supervisors/users have over auto attendants and call queues.

Get-CsTeamTemplate

This cmdlet supports retrieving details of a team template available to your tenant given the team template uri.

NOTE: The returned template definition is a PowerShell object formatted as a JSON for readability. Please refer to the examples for suggested interaction flows for template management.

Get-CsTeamTemplateList

This cmdlet supports retrieving information of all team templates available to your tenant, including both first party Microsoft team templates as well as custom templates. The templates information retrieved includes includes OData Id, template name, short description, count of channels and count of applications.
Note: All custom templates will be retrieved, regardless of the locale specification. If you have hidden templates in the admin center, you will still be able to see the hidden templates here.

Get-CsUserCallingSettings

This cmdlet will show the call forwarding, simultaneous ringing, call group and delegation settings for a user.

Get-CsUserPolicyAssignment

This cmdlet is used to return the policy assignments for a user, both directly assigned and inherited from a group.

Get-CsUserPolicyPackage

This cmdlet supports retrieving the policy package that's assigned to a user.

Get-CsUserPolicyPackageRecommendation

This cmdlet supports retrieving recommendations for which policy packages are best suited for a given user.

Get-LicenseReportForChangeNotificationSubscription

This cmdlet tells whether a user has the required license to export their messages via change notification subscription.

Get-SharedWithTeam

This cmdlet supports retrieving teams with which a specified channel is shared.

Get-SharedWithTeamUser

This cmdlet supports retrieving users of a shared with team.

Get-Team

This cmdlet supports retrieving teams with particular properties/information, including 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-TeamAllChannel

This cmdlet supports retrieving all channels of a team, including incoming channels and channels hosted by the team.

Get-TeamChannel

This cmdlet supports retrieving channels hosted by a team.

Get-TeamChannelUser

Returns users of a channel.

Get-TeamFunSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To retrieve a Team's fun settings, run Get-Team.

Gets a team's fun settings.

Get-TeamGuestSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To retrieve a Team's guest settings, run Get-Team.

Gets Team guest settings.

Get-TeamIncomingChannel

This cmdlet supports retrieving incoming channels of a team.

Get-TeamMemberSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To retrieve a Team's member settings, run Get-Team.

Gets team member settings.

Get-TeamMessagingSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To retrieve a Team's messaging settings, run Get-Team.

Gets team messaging settings.

Get-TeamsApp

Returns app information from the Teams tenant app store.

Get-TeamsAppInstallation

Get a Teams App installed in Microsoft Teams.

Get-TeamTargetingHierarchyStatus

Get the status of a hierarchy upload (see Set-TeamTargetingHierarchy)

Get-TeamUser

Returns users of a team.

Grant-CsGroupPolicyPackageAssignment

This cmdlet assigns a policy package to a group in a tenant.

Grant-CsTeamsEnhancedEncryptionPolicy

Cmdlet to assign a specific Teams enhanced encryption Policy to a user.

Grant-CsTeamsEventsPolicy

Assigns Teams Events policy to a user, group of users, or the entire tenant. Note that this policy is currently still in preview.

Grant-CsTeamsMediaLoggingPolicy

Assigns Teams Media Logging policy to a user or entire tenant.

Grant-CsTeamsShiftsPolicy

This commandlet supports applying the TeamsShiftsPolicy to users in a tenant.

Grant-CsTeamsVoiceApplicationsPolicy

Assigns a per-user Teams voice applications policy to one or more users. TeamsVoiceApplications policy governs what permissions the supervisors/users have over auto attendants and call queues.

Grant-CsUserPolicyPackage

This cmdlet supports applying a policy package to users in a tenant. Note that there is a limit of 20 users you can apply the package to at a time. To apply a policy package to a larger number of users, consider using New-CsBatchPolicyPackageAssignmentOperation.

New-CsBatchPolicyAssignmentOperation

This cmdlet is used to assign or unassign a policy to a batch of users.

New-CsBatchPolicyPackageAssignmentOperation

This cmdlet submits an operation that applies a policy package to a batch of users in a tenant. A batch may contain up to 5000 users.

New-CsBatchTeamsDeployment

This cmdlet is used to run a batch deployment orchestration.

New-CsCloudCallDataConnection

This cmdlet creates an online call data connection.

New-CsCustomPolicyPackage

Note: This cmdlet is currently in private preview.

This cmdlet creates a custom policy package.

New-CsGroupPolicyAssignment

This cmdlet is used to assign a policy to a security group or distribution list.

New-CsHybridTelephoneNumber

This cmdlet adds a hybrid telephone number to the tenant.

New-CsOnlineTelephoneNumberOrder

Use the New-CsOnlineTelephoneNumberOrder cmdlet to create a telephone number search order. The telephone numbers can then be used to set up calling features for users and services in your organization.

New-CsTeamsEnhancedEncryptionPolicy

Use this cmdlet to create a new Teams enhanced encryption policy.

New-CsTeamsEventsPolicy

This cmdlet allows you to create a new TeamsEventsPolicy instance and set its properties. Note that this policy is currently still in preview.

New-CsTeamsShiftsConnection

This cmdlet creates a new workforce management (WFM) connection.

New-CsTeamsShiftsConnectionBatchTeamMap

This cmdlet submits an operation connecting multiple Microsoft Teams teams and Workforce management (WFM) teams.

New-CsTeamsShiftsConnectionInstance

This cmdlet creates a Shifts connection instance.

New-CsTeamsShiftsPolicy

This cmdlet allows you to create a new TeamsShiftPolicy instance and set it's properties.

New-CsTeamsUnassignedNumberTreatment

Creates a new treatment for how calls to an unassigned number range should be routed. The call can be routed to a user, an application or to an announcement service where a custom message will be played to the caller.

New-CsTeamsVoiceApplicationsPolicy

Creates a new Teams voice applications policy. TeamsVoiceApplications policy governs what permissions the supervisors/users have over auto attendants and call queues.

New-CsTeamTemplate

This cmdlet lets you provision a new team template for use in Microsoft Teams. To learn more about team templates, see Get started with Teams templates in the admin center.

NOTE: The response is a PowerShell object formatted as a JSON for readability. Please refer to the examples for suggested interaction flows for template management.

New-CsUserCallingDelegate

This cmdlet will add a new delegate for calling in Microsoft Teams.

New-Team

This cmdlet lets you provision a new Team for use in Microsoft Teams and will create an O365 Unified Group to back the team. Groups created through teams cmdlets, APIs, or clients will not show up in Outlook by default.

If you want these groups to appear in Outlook clients, you can use the Set-UnifiedGroup cmdlet in the Exchange Powershell Module to disable the switch parameter HiddenFromExchangeClientsEnabled (-HiddenFromExchangeClientsEnabled:$false).

Note: The Teams application may need to be open by an Owner for up to two hours before changes are reflected.

New-TeamChannel

Add a new channel to a team.

New-TeamsApp

Creates a new app in the Teams tenant app store.

Remove-CsCustomPolicyPackage

This cmdlet deletes a custom policy package.

Remove-CsGroupPolicyAssignment

This cmdlet is used to remove a group policy assignment.

Remove-CsHybridTelephoneNumber

This cmdlet removes a hybrid telephone number.

Remove-CsPhoneNumberAssignment

This cmdlet will remove/unassign a phone number from a user or a resource account (online application instance).

Remove-CsTeamsEnhancedEncryptionPolicy

Use this cmdlet to remove an existing Teams enhanced encryption policy.

Remove-CsTeamsEventsPolicy

The CsTeamsEventsPolicy cmdlets removes a previously created TeamsEventsPolicy. Note that this policy is currently still in preview.

Remove-CsTeamsShiftsConnectionInstance

This cmdlet deletes a Shifts connection instance.

Remove-CsTeamsShiftsConnectionTeamMap

This cmdlet removes the mapping between the Microsoft Teams team and workforce management (WFM) team.

Remove-CsTeamsShiftsPolicy

The Remove-CsTeamsShiftsPolicy cmdlet removes a previously created TeamsShiftsPolicy.

Note: A TeamsShiftsPolicy needs to be unassigned from all the users before it can be deleted.

Remove-CsTeamsShiftsScheduleRecord

This cmdlet enqueues the clear schedule message.

Remove-CsTeamsUnassignedNumberTreatment

Removes a treatment for how calls to an unassigned number range should be routed.

Remove-CsTeamsVoiceApplicationsPolicy

Deletes an existing Teams voice applications policy.

Remove-CsTeamTemplate

This cmdlet deletes a specified Team Template from Microsoft Teams.

Remove-CsUserCallingDelegate

This cmdlet will remove a delegate for calling in Microsoft Teams.

Remove-SharedWithTeam

This cmdlet supports unsharing a channel with a team.

Remove-Team

This cmdlet deletes a specified Team from Microsoft Teams.

NOTE: The associated Office 365 Unified Group will also be removed.

Remove-TeamChannel

Delete a channel. This will not delete content in associated tabs.

Note: The channel will be "soft deleted", meaning the contents are not permanently deleted for a time. So a subsequent call to Add-TeamChannel using the same channel name will fail if enough time has not passed.

Remove-TeamChannelUser

Note: the command will return immediately, but the Teams application will not reflect the update immediately, please refresh the members page to see the update.

To turn an existing Owner into an Member, specify role parameter as Owner.

Note: last owner cannot be removed from the private channel.

Remove-TeamsApp

Removes an app in the Teams tenant app store.

Remove-TeamsAppInstallation

Removes a Teams App installed in Microsoft Teams.

Remove-TeamTargetingHierarchy

Removes the tenant's hierarchy.

Remove-TeamUser

Remove an owner or member from a team, and from the unified group which backs the team.

Note: the command will return immediately, but the Teams application will not reflect the update immediately. The Teams application may need to be open for up to an hour before changes are reflected.

Note: last owner cannot be removed from the team.

Set-CsGroupPolicyAssignment

Note

The cmdlet Set-CsGroupPolicyAssignment is not yet available. In the meantime, to change a group policy assignment you can first remove the current policy assignment from the group and then add a new policy assignment.

Set-CsPhoneNumberAssignment

This cmdlet will assign a phone number to a user or a resource account (online application instance).

Set-CsTeamsAcsFederationConfiguration

Limited Preview: Functionality described in this document is currently in limited preview and only authorized organizations have access. This preview version is provided without a service-level agreement, and is not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

This cmdlet is used to manage the federation configuration between Teams and Azure Communication Services. For more information, please see Azure Communication Services and Teams Interoperability.

Set-CsTeamsEducationConfiguration

This cmdlet is used to manage the organization-wide education configuration for Teams.

Set-CsTeamsEnhancedEncryptionPolicy

Use this cmdlet to update values in existing Teams enhanced encryption policy.

Set-CsTeamsEventsPolicy

This cmdlet allows you to configure options for customizing Teams events experiences. Note that this policy is currently still in preview.

Set-CsTeamsShiftsConnection

This cmdlet sets an existing workforce management (WFM) connection.

Set-CsTeamsShiftsConnectionInstance

This cmdlet updates a Shifts connection instance.

Set-CsTeamsShiftsPolicy

This cmdlet allows you to set or update properties of a TeamsShiftPolicy instance, including Teams off shift warning message-specific settings.

Set-CsTeamsUnassignedNumberTreatment

Changes a treatment for how calls to an unassigned number range should be routed. The call can be routed to a user, an application or to an announcement service where a custom message will be played to the caller.

Set-CsTeamsVoiceApplicationsPolicy

Modifies an existing Teams voice applications policy.

Set-CsUserCallingDelegate

This cmdlet will change permissions for a delegate for calling in Microsoft Teams.

Set-CsUserCallingSettings

This cmdlet will set the call forwarding, simultaneous ringing and call group settings for the specified user.

Set-Team

This cmdlet allows you to update properties of a team, including its displayname, description, and team-specific settings.

Set-TeamArchivedState

This cmdlet is used to freeze all of the team activity, but Teams Administrators and team owners will still be able to add or remove members and update roles. You can unarchive the team anytime.

Set-TeamChannel

Update Team channels settings.

Set-TeamFunSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To set a Team's settings, run Set-Team.

Update Giphy, Stickers and Memes settings.

Set-TeamGuestSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To set a Team's settings, run Set-Team.

Updates team guest settings.

Set-TeamMemberSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To set a Team's settings, run Set-Team.

Updates team member settings.

Set-TeamMessagingSettings

Note: This cmdlet is deprecated as of our 1.0 PowerShell release, and is not supported in our 1.0 release. To set a Team's settings, run Set-Team.

Updates team messaging settings.

Set-TeamPicture

Update the team picture.

Note: the command will return immediately, but the Teams application will not reflect the update immediately. The Teams application may need to be open for up to an hour before changes are reflected.

Note: this cmdlet is not support in special government environments (TeamsGCCH and TeamsDoD) and is currently only supported in our beta release.

Set-TeamsApp

Updates an app in the Teams tenant app store.

Set-TeamsEnvironmentConfig

Sets environment-specific configurations on the local machine and is used to connect to the right environment when running Connect-MicrosoftTeams.

Set-TeamTargetingHierarchy

Upload a hierarchy to the tenant. A tenant may only have 1 active hierarchy. Each Set-TeamTargetingHierarchy cmdlet call will overwrite the previous one.

Test-CsTeamsShiftsConnectionValidate

This cmdlet validates workforce management (WFM) connection settings.

Test-CsTeamsUnassignedNumberTreatment

This cmdlet tests the given number against the created (by using New-CsTeamsUnassignedNumberTreatment cmdlet) unassigned number treatment configurations.

Update-CsCustomPolicyPackage

Note: This cmdlet is currently in private preview.

This cmdlet updates a custom policy package.

Update-CsTeamsShiftsConnection

This cmdlet updates an existing workforce management (WFM) connection.

Update-CsTeamsShiftsConnectionInstance

This cmdlet updates Shifts connection instance fields.

Update-CsTeamTemplate

This cmdlet submits an operation that updates a custom team template with new team template settings.

NOTE: The response is a PowerShell object formatted as a JSON for readability. Please refer to the examples for suggested interaction flows for template management.

Update-TeamsAppInstallation

Update a Teams App in Microsoft Teams.