Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.
🚀 Launch ToolkitManaging multiple Microsoft Teams settings manually can be tedious for IT admins. If you're looking to enable or restrict fun settings like Giphy, memes, and stickers across many Teams at once, this Graph PowerShell script will automate the job for you.
Create a CSV file named something like TeamsFunSettings.csv with the following headers and values:
TeamId,AllowGiphy,GiphyContentRating,AllowStickersAndMemes,AllowCustomMemes
a1b2c3d4-5678-90ab-cdef-1234567890ab,true,moderate,true,false
b2c3d4e5-6789-01bc-defa-2345678901bc,false,strict,false,false
Column Name | Description |
TeamId | The unique ID of the Microsoft Team. |
AllowGiphy | Accepts true or false to enable/disable Giphy integration. |
GiphyContentRating | Accepts moderate or strict to control GIF appropriateness. |
AllowStickersAndMemes | Enables/disables stickers and default memes. |
AllowCustomMemes | Controls if users can upload custom memes. |
📌 Note: Values are case-insensitive but should be valid (true/false, moderate/strict).
# Import CSV
$teams = Import-Csv -Path "C:\Path\To\TeamsFunSettings.csv"
foreach ($team in $teams) {
Write-Host "Updating fun settings for Team ID: $($team.TeamId)" -ForegroundColor Cyan
# Create hashtable for fun settings
$funSettings = @{
allowGiphy = [bool]$team.AllowGiphy
giphyContentRating = $team.GiphyContentRating
allowStickersAndMemes = [bool]$team.AllowStickersAndMemes
allowCustomMemes = [bool]$team.AllowCustomMemes
}
try {
Update-MgTeam -TeamId $team.TeamId -FunSettings $funSettings
Write-Host "Updated successfully." -ForegroundColor Green
}
catch {
Write-Host "Failed to update team $($team.TeamId): $_" -ForegroundColor Red
}
}
The script reads from a CSV file with the appropriate columns shown above.
It loops through each row, constructs a -FunSettings hashtable, and applies it using Update-MgTeam.
Update-MgTeam: Updates the team’s settings, including fun settings.
Uses try/catch blocks to catch and report errors for each individual team, ensuring the script continues running.
Here are a few ways to make the script even more robust:
Enhancement | Description |
Add Logging | Export success/failure info to a log file. |
Validate Inputs | Check CSV for missing or invalid values before applying updates. |
Parallel Execution | Use background jobs or runspaces for faster processing on large tenants. |
Dry-Run Mode | Add a flag to simulate updates before actually applying them. |
Multi-setting Update | Expand the script to update MemberSettings, MessagingSettings, or GuestSettings alongside FunSettings. |
Error | Cause | Solution |
Access Denied or Forbidden | Missing permissions | Ensure the Graph app/token has TeamSettings.ReadWrite.All permission. |
Invalid request: giphyContentRating | Wrong content rating value | Use only moderate or strict (case-sensitive). |
Object not found | Incorrect Team ID | Validate that the TeamId in the CSV exists in your tenant. |
Cannot convert 'true' to type 'Boolean' | Value in CSV is a string | Use [bool] type cast as shown in the script to fix this. |
Throttling/Too many requests | Large number of updates in short time | Add Start-Sleep -Seconds 1 between requests or handle 429 retries. |
You can use the following Graph PowerShell command:
Get-MgTeam | Select-Object Id, DisplayName
Only two values are valid:
Yes. Just set:
AllowStickersAndMemes,true
AllowCustomMemes,false
Yes. Run:
Get-MgTeam -TeamId "your-team-id" | Select-Object -ExpandProperty FunSettings
No. Fun settings apply to the team as a whole, not to individual channels.
This Graph PowerShell script streamlines the management of Teams fun settings across your organization. With a well-structured CSV and a few lines of PowerShell, you can enable or restrict Giphy, memes, and stickers in bulk—saving time and ensuring compliance with company policies.
© m365corner.com. All Rights Reserved. Design by HTML Codex