MicrosoftMicrosoft TeamsPowershell

Top 20 PowerShell Cmdlets for Advanced Microsoft Teams Administration


Microsoft Teams has rapidly become an indispensable collaboration platform for organizations worldwide, enabling seamless communication, file sharing, and project management. As the adoption of Teams continues to grow, IT professionals and administrators face the challenge of efficiently managing and maintaining this powerful solution. Fortunately, PowerShell provides a robust set of cmdlets that can streamline and automate various administrative tasks, empowering IT teams to optimize their Teams environment effectively.

In this comprehensive article, we will explore the top 20 PowerShell cmdlets that every advanced Microsoft Teams administrator should have in their toolkit. These cmdlets will unlock powerful capabilities, ranging from user management and team creation to compliance and reporting, ensuring a seamless and secure Teams experience for your organization.


This cmdlet allows administrators to create new teams within their Microsoft Teams environment. It offers a wide range of parameters to customize team settings, such as team visibility, team description, and team owners.


New-Team -DisplayName "Marketing Team" -MailNickName "MarketingTeam" -Visibility Public -Description "Team for the marketing department"


With the Set-Team cmdlet, administrators can modify various properties of an existing team, including the team name, description, and settings for guest access, messaging, and more.


Set-Team -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -DisplayName "Marketing Dept" -Description "Updated description for the marketing team"


This cmdlet retrieves information about teams within your organization. It allows filtering and sorting based on various criteria, such as team name, team description, or team ID.


Get-Team -DisplayName "Marketing*" | Select-Object DisplayName, Description, Visibility


Creating channels within teams is essential for organizing conversations and content. The New-TeamChannel cmdlet enables administrators to add new channels to existing teams.


New-TeamChannel -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -DisplayName "Social Media" -Description "Channel for social media campaigns"


Similar to modifying team properties, administrators can use the Set-TeamChannel cmdlet to update channel settings, such as the channel name, description, or membership.


Set-TeamChannel -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -CurrentDisplayName "Social Media" -NewDisplayName "Digital Marketing" -Description "Updated channel for digital marketing initiatives"



Get-TeamChannel -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object DisplayName, Description


Managing team membership is crucial for collaboration and access control. The Add-TeamUser cmdlet allows administrators to add new users to existing teams, granting them access to team resources and conversations.


Add-TeamUser -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -User "" -Role Owner


Conversely, the Remove-TeamUser cmdlet enables administrators to remove users from a team, revoking their access to team resources and conversations.


Get-TeamUser -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object User, Role


Configuring messaging settings is essential for maintaining a productive and secure communication environment within teams. The New-TeamMessagingSettings cmdlet allows administrators to set messaging policies, such as enabling or disabling specific messaging features or controlling external access.


New-TeamMessagingSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -AllowGiphy $false -AllowStickersAndMemes $false


Similar to creating new messaging settings, the Set-TeamMessagingSettings cmdlet enables administrators to modify existing messaging settings for a team.


Set-TeamMessagingSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -AllowGiphy $true -AllowStickersAndMemes $true


This cmdlet retrieves the current messaging settings for a specific team or across all teams in your organization.


Get-TeamMessagingSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object AllowGiphy, AllowStickersAndMemes


In addition to messaging settings, Teams administrators can configure fun settings to enhance the user experience and foster a more engaging collaboration environment. The New-TeamFunSettings cmdlet allows administrators to enable or disable features such as custom memes, GIFs, and stickers.


New-TeamFunSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -AllowGiphy $true -AllowStickersAndMemes $true


Similar to creating new fun settings, the Set-TeamFunSettings cmdlet enables administrators to modify existing fun settings for a team.


Set-TeamFunSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -AllowGiphy $false -AllowStickersAndMemes $false


This cmdlet retrieves the current fun settings for a specific team or across all teams in your organization.


Get-TeamFunSettings -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object AllowGiphy, AllowStickersAndMemes


Compliance and governance are critical aspects of managing Teams environments, especially in regulated industries. The New-TeamComplianceRecord cmdlet allows administrators to create compliance records for teams, enabling them to track and maintain compliance with organizational policies and regulations.


New-TeamComplianceRecord -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -ComplianceDescriptor "GDPR Compliance" -ComplianceDescription "Team complies with GDPR regulations"


This cmdlet retrieves compliance records for a specific team or across all teams in your organization, enabling administrators to review and audit compliance status.


Get-TeamComplianceRecord -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object ComplianceDescriptor, ComplianceDescription


In addition to creating compliance records, administrators can define custom compliance fields using the New-TeamComplianceRecordField cmdlet. These custom fields can be used to capture and track additional compliance-related information specific to your organization’s requirements.

Recommended For You:  Implementing PowerShell Desired State Configuration (DSC) for Hyper-V Environments


New-TeamComplianceRecordField -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -FieldName "DataRetentionPolicy" -FieldValue "3 years"


This cmdlet retrieves the custom compliance record fields defined for a specific team or across all teams in your organization.


Get-TeamComplianceRecordField -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" | Select-Object FieldName, FieldValue


Reporting and analytics are essential for monitoring and optimizing your Teams environment. The Get-TeamReport cmdlet provides administrators with comprehensive reports on various aspects of Teams usage, including user activity, team membership, and channel activity.


Get-TeamReport -GroupId "c38fd33e-1235-4c5d-8734-5d7c85ecf8f1" -ReportType UserActivity -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date)


Mastering these top 20 PowerShell cmdlets will empower advanced Microsoft Teams administrators to streamline and automate various administrative tasks, ensuring efficient management and governance of their Teams environment. From user and team management to compliance and reporting, these cmdlets provide a comprehensive toolkit for optimizing collaboration, productivity, and security within your organization’s Teams deployment.

By leveraging the power of PowerShell, administrators can save valuable time and resources, enabling them to focus on strategic initiatives and deliver an exceptional Teams experience to their users.


  1. How can I automate the execution of these cmdlets? You can create PowerShell scripts or scheduled tasks to automate the execution of these cmdlets, enabling regular maintenance and administration tasks to be performed without manual intervention.

  2. Can these cmdlets be used with multi-tenant environments? Yes, many of these cmdlets support multi-tenant environments, allowing administrators to manage Teams across multiple tenants or organizations from a centralized location.

  3. Are there any prerequisites for using these cmdlets? To use these cmdlets, you will need to have the appropriate permissions and access rights within your Microsoft 365 environment. Additionally, you may need to install and configure the Microsoft Teams PowerShell module.

  4. Can I integrate these cmdlets with other PowerShell modules or scripts? Absolutely! These cmdlets can be integrated with other PowerShell modules or scripts, enabling you to create custom solutions tailored to your organization’s specific needs and workflows.

  5. Are there any security considerations when using these cmdlets? Yes, it’s important to follow best practices for PowerShell scripting and ensure that your scripts and cmdlet executions are secure. This includes validating input, handling errors appropriately, and implementing proper access controls and auditing mechanisms.

Continue your research with these additional resources:

For those interested in automating Microsoft Teams notifications using PowerShell, check out this comprehensive guide: Automate Microsoft Teams Notifications with PowerShell: A Step-by-Step Guide

Muhammad Faizan

Hi, My name is Muhammad Faizan and i have spent last 15 years working as System Administrator mainly with Microsoft Technologies. I am MCSE, MCTP, MCITP, certified professional. I love scripting and Powershell is the scripting language i am in love with.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button