Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.
🚀 Launch ToolkitManaging user experience options in Microsoft Teams is vital for maintaining a balance between collaboration and control. Administrators often need to review Fun Settings (like Giphy, memes, and stickers) across all Teams to ensure that these features align with organizational policies.
With Microsoft Graph PowerShell, you can easily fetch these settings from all Teams in your tenant and automatically email the report to your administrator for auditing and governance purposes.
$AdminUPN = "admin@contoso.com"
$results=@()
foreach ($team in $allTeams) {
try {
# Retrieve Fun Settings for each team
$teamDetails=Get-MgTeam -TeamId $team.Id
# Extract boolean values and content rating
$giphyStatus=$teamDetails.FunSettings.allowGiphy
$giphyRating=$teamDetails.FunSettings.giphyContentRating
$stickersStatus=$teamDetails.FunSettings.allowStickersAndMemes
$customMemeStatus=$teamDetails.FunSettings.allowCustomMemes
# Add to result list
$results +=[pscustomobject]@{
"Team Name" =$team.DisplayName
"AllowGiphy" =$giphyStatus
"GiphyContentRating" =$giphyRating
"AllowStickersAndMemes" =$stickersStatus
"AllowCustomMemes" =$customMemeStatus
}
}
catch {
Write-Warning "Failed to retrieve fun settings for team: $($team.DisplayName)"
}
}
$ReportPath ="$env:TEMP\TeamsFunSettingsReport.csv"
$results | Sort-Object "Team Name" | Export-Csv -Path $ReportPath -NoTypeInformation -Encoding UTF8
$Subject="Microsoft Teams Fun Settings Report — $(Get-Date -Format 'yyyy-MM-dd')"
$Body=@"
Hello Admin,<br><br>
Attached is the latest report of Microsoft Teams Fun Settings across all teams in the tenant.
Total Teams Analyzed: <b>$teamCount</b><br><br>
Fields include: AllowGiphy, GiphyContentRating, AllowStickersAndMemes, and AllowCustomMemes.<br><br>
Regards,<br>
Graph PowerShell Script
"@
# Read and attach the CSV
$AttachmentContent = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($ReportPath))
$Attachments = @(
@{
"@odata.type" = "#microsoft.graph.fileAttachment"
Name = [System.IO.Path]::GetFileName($ReportPath)
ContentBytes = $AttachmentContent
}
)
# Build email payload
$Message = @{
Message = @{
Subject = $Subject
Body = @{
ContentType = "HTML"
Content = $Body
}
ToRecipients = @(
@{ EmailAddress = @{ Address = $AdminUPN } }
)
Attachments = $Attachments
}
SaveToSentItems = "true"
}
# Send email to the admin
Send-MgUserMail -UserId $AdminUPN -BodyParameter $Message
Write-Host "Teams Fun Settings report emailed successfully to $AdminUPN"
| Error | Cause | Solution |
|---|---|---|
| Insufficient privileges to complete the operation | Missing Microsoft Graph permissions. | Use Connect-MgGraph -Scopes "Team.Read.All","Mail.Send". |
| Send-MgUserMail : Resource not found | The $AdminUPN specified is not a valid mailbox. | Replace $AdminUPN with a valid mailbox-enabled account. |
| Access Denied while fetching Team details | The connected account doesn’t have sufficient privileges on some Teams. | Use an account with Teams Administrator or Global Administrator rights. |
| Empty CSV File | The tenant might not have any Teams or Graph throttled the call. | Retry after a few minutes or validate Teams availability. |
This Graph PowerShell script provides administrators with an automated way to review Microsoft Teams Fun Settings across the tenant. By fetching details such as Giphy permissions, meme settings, and stickers, it helps ensure that collaboration features align with company policy.
With automated emailing and scheduling, this script makes Teams governance effortless, delivering consistent visibility to administrators while saving time on manual checks.
© m365corner.com. All Rights Reserved. Design by HTML Codex