In Part 1 of our Microsoft Teams PowerShell Module series, we explored how to retrieve Team configurations using Get-Team and its companion read cmdlets. In Part 2, we focus on modifying and governing Team settings at scale using Set-Team, Set-TeamChannel, and Set-TeamPicture—as well as how the MicrosoftTeams PowerShell Module (v6+) and Microsoft Graph PowerShell SDK (Update-MgTeam) handle the legacy granular Set-TeamSettings cmdlets.
Evolution of the Set-Team Cmdlets (Module v1 vs. Modern v6+ & Graph SDK)
When the MicrosoftTeams PowerShell module first launched, Microsoft separated Team configuration into five distinct cmdlets:
Set-Team(DisplayName, Description, Visibility, Classification)Set-TeamFunSettings(Giphy, Stickers, Memes)Set-TeamGuestSettings(Guest channel creation/deletion)Set-TeamMemberSettings(Member channel, app, tab, and connector permissions)Set-TeamMessagingSettings(User message editing, deletion,@teamand@channelmentions)
In modern MicrosoftTeams PowerShell (v4.x through v6.x+), Microsoft consolidated all of those settings directly into Set-Team so administrators can update a Team's metadata, member permissions, guest permissions, messaging policy, and fun settings in a single atomic API call instead of five sequential round-trips.
1. Set-Team: Modify Core Team Properties (DisplayName, Visibility, Description)
Using Set-Team, you can update a Team's DisplayName, Description, Classification, MailNickName, and Visibility (Public or Private):
# Connect to Microsoft Teams PowerShell
Connect-MicrosoftTeams
$GroupId = "ee7781b7-4d45-4a39-ade4-d7872de6490c"
# Update core Team metadata
Set-Team -GroupId $GroupId `
-DisplayName "Enterprise Cloud Engineering" `
-Description "Core infrastructure & automation team" `
-Visibility "Private" `
-Classification "Confidential"
2. Set-TeamChannel: Rename or Update a Team Channel
With Set-TeamChannel, you can rename an existing channel (-CurrentDisplayName to -NewDisplayName) or update its description:
$GroupId = "ee7781b7-4d45-4a39-ade4-d7872de6490c"
# Rename a channel and update its description
Set-TeamChannel -GroupId $GroupId `
-CurrentDisplayName "MS Teams Powershell OverView" `
-NewDisplayName "MSTEAM PS Overview" `
-Description "PowerShell automation scripts and governance runbooks"
3. Fun Settings (Set-Team vs. Legacy Set-TeamFunSettings)
Fun settings control whether team members can post Giphy GIFs, Stickers, and Memes, as well as the content rating filter (Strict or Moderate):
AllowGiphy($true/$false)GiphyContentRating(Strict/Moderate)AllowStickersAndMemes($true/$false)AllowCustomMemes($true/$false)
$GroupId = "4525d75e-0d10-4644-9787-335899c097fe"
# Modern MicrosoftTeams Module (v6+): Consolidated into Set-Team
Set-Team -GroupId $GroupId `
-AllowGiphy $false `
-GiphyContentRating "Strict" `
-AllowStickersAndMemes $false `
-AllowCustomMemes $false
# Legacy MicrosoftTeams Module (v1.x):
# Set-TeamFunSettings -GroupId $GroupId -AllowGiphy $false
Once applied, the GIF and Sticker icons disappear from the Teams compose box for that Team.
4. Guest Channel Permissions (Set-Team vs. Legacy Set-TeamGuestSettings)
Guest settings control whether external guests inside a Team can create, update, or delete channels. By default, both settings are $false (and for security compliance, should remain $false unless explicitly required):
AllowGuestCreateUpdateChannels(LegacySet-TeamGuestSettings:-AllowCreateUpdateChannels)AllowGuestDeleteChannels(LegacySet-TeamGuestSettings:-AllowDeleteChannels)
$GroupId = "4525d75e-0d10-4644-9787-335899c097fe"
# Modern MicrosoftTeams Module (v6+): Note the 'Guest' prefix in parameter names
Set-Team -GroupId $GroupId `
-AllowGuestCreateUpdateChannels $false `
-AllowGuestDeleteChannels $false
# Legacy MicrosoftTeams Module (v1.x):
# Set-TeamGuestSettings -GroupId $GroupId -AllowCreateUpdateChannels $true -AllowDeleteChannels $true
Want to block guests from joining a Team altogether? See our full guide: How to Enable or Disable Guest Access in Microsoft Teams.
5. Member Permissions (Set-Team vs. Legacy Set-TeamMemberSettings)
Member settings govern what regular internal Team Members (non-Owners) are allowed to configure inside the Team. By default, Microsoft enables all five permissions, which often leads to channel sprawl in large Teams:
AllowCreateUpdateChannels($true/$false)AllowCreatePrivateChannels($true/$false)AllowDeleteChannels($true/$false)AllowAddRemoveApps($true/$false)AllowCreateUpdateRemoveTabs($true/$false)AllowCreateUpdateRemoveConnectors($true/$false)
$GroupId = "4525d75e-0d10-4644-9787-335899c097fe"
# Lock down a Team so only Team Owners can create/delete channels or install apps
Set-Team -GroupId $GroupId `
-AllowCreateUpdateChannels $false `
-AllowCreatePrivateChannels $false `
-AllowDeleteChannels $false `
-AllowAddRemoveApps $false `
-AllowCreateUpdateRemoveTabs $false `
-AllowCreateUpdateRemoveConnectors $false
# Legacy MicrosoftTeams Module (v1.x):
# Set-TeamMemberSettings -GroupId $GroupId -AllowCreateUpdateChannels $false
6. Messaging Settings (Set-Team vs. Legacy Set-TeamMessagingSettings)
Messaging settings control whether users can edit or delete their sent messages and whether @team or @channel mentions are allowed:
AllowUserEditMessages($true/$false)AllowUserDeleteMessages($true/$false)AllowOwnerDeleteMessages($true/$false)AllowTeamMentions($true/$false)AllowChannelMentions($true/$false)
$GroupId = "4525d75e-0d10-4644-9787-335899c097fe"
# Compliance Lockdown: Prevent users from editing or deleting sent channel messages
Set-Team -GroupId $GroupId `
-AllowUserEditMessages $false `
-AllowUserDeleteMessages $false `
-AllowOwnerDeleteMessages $false `
-AllowTeamMentions $true `
-AllowChannelMentions $true
# Legacy MicrosoftTeams Module (v1.x):
# Set-TeamMessagingSettings -GroupId $GroupId -AllowUserEditMessages $false -AllowUserDeleteMessages $false
7. Set-TeamPicture: Update the Team Avatar Image
You can standardize Team avatars across your organization using Set-TeamPicture:
$GroupId = "4525d75e-0d10-4644-9787-335899c097fe"
Set-TeamPicture -GroupId $GroupId -ImagePath "C:\TeamsAssets\CloudEngineering-Avatar.jpg"
Bonus: Updating All Team Settings in One Call via Microsoft Graph (Update-MgTeam)
If you are migrating your automation scripts to the Microsoft Graph PowerShell SDK (Microsoft.Graph.Teams) as covered in our PowerShell 5.1 to 7 & Microsoft Graph Migration Guide, you can configure all Member, Guest, Messaging, and Fun settings in a single Update-MgTeam payload:
Import-Module Microsoft.Graph.Teams
Connect-MgGraph -Scopes "TeamSettings.ReadWrite.All" -NoWelcome
$TeamId = "4525d75e-0d10-4644-9787-335899c097fe"
$TeamSettingsPayload = @{
memberSettings = @{
allowCreateUpdateChannels = $false
allowCreatePrivateChannels = $false
allowDeleteChannels = $false
allowAddRemoveApps = $false
allowCreateUpdateRemoveTabs = $false
allowCreateUpdateRemoveConnectors = $false
}
guestSettings = @{
allowCreateUpdateChannels = $false
allowDeleteChannels = $false
}
messagingSettings = @{
allowUserEditMessages = $false
allowUserDeleteMessages = $false
allowOwnerDeleteMessages = $false
allowTeamMentions = $true
allowChannelMentions = $true
}
funSettings = @{
allowGiphy = $false
giphyContentRating = "strict"
allowStickersAndMemes = $false
allowCustomMemes = $false
}
}
Update-MgTeam -TeamId $TeamId -BodyParameter $TeamSettingsPayload
Write-Host "[✔] Team governance settings updated via Microsoft Graph!" -ForegroundColor Green
Complete Microsoft Teams PowerShell Series Index
- Prerequisite: How to Install and Connect to the Microsoft Teams PowerShell Module
- Part 1: Auditing Teams, Channels, and Users (
Get-Team,Get-TeamChannel,Get-TeamUser) - Part 2: Modifying Team Settings & Governance (
Set-Team,Set-TeamChannel,Set-TeamPicture) - Part 3: Provisioning & Decommissioning Teams (
New-Team,New-TeamChannel,Add-TeamUser,Remove-Team)