đź”§ New: User Management Graph PowerShell Toolkit

Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.

🚀 Launch Toolkit

Fetch Microsoft Teams Fun Settings Using Graph PowerShell

Microsoft Teams allows organizations to control "fun stuff" like Giphy, stickers, and memes to promote professionalism or enhance engagement. But how can an admin view these settings across all Teams at once?

This Graph PowerShell script gives you the power to audit fun settings like Giphy, stickers, and custom memes across every Team in your tenant—with an option to export to CSV for documentation or review.


The Script: List Teams Fun Settings and Export to CSV

# Connect to Microsoft Graph if not already connected 
# Connect-MgGraph -Scopes Team.Read.All
                                
# Retrieve all Teams in the tenant
$allTeams = Get-MgTeam -All
                                
# Initialize results array
$results = @()
                                
foreach ($team in $allTeams) {
    try {
        # This call properly retrieves all FunSettings for each team
        $teamDetails = Get-MgTeam -TeamId $team.Id
                                        
        # Extract actual boolean values
        $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)"
    }
}
                                
# Display results
$results | Format-Table -AutoSize
                                
# Prompt for CSV export
$export = Read-Host "`nDo you want to export the results to a CSV file? (Y/N)"
if ($export -match '^(Y|y)$') {
    $outputPath = Read-Host "Enter full file path for export (e.g., C:\Reports\TeamsFunSettings.csv)"
    try {
        $results | Export-Csv -Path $outputPath -NoTypeInformation -Encoding UTF8
        Write-Host "Exported successfully to $outputPath" -ForegroundColor Green
    }
    catch {
        Write-Host "Failed to export file: $_" -ForegroundColor Red
    }
}
                            

How the Script Works

Here’s a breakdown of what the script does:

  1. Connects to Microsoft Graph
  2. Requires the Team.Read.All permission scope. This grants read access to all Microsoft Teams in the tenant.

  3. Fetches All Teams
  4. Uses Get-MgTeam -All to retrieve a list of all existing Microsoft Teams.

  5. Fetches Fun Settings Individually
  6. For each team, it uses Get-MgTeam -TeamId again to accurately fetch FunSettings. This is crucial because the initial list does not contain complete settings.

  7. Extracts Settings
  8. Captures:

    • AllowGiphy (true/false)
    • GiphyContentRating (moderate/strict)
    • AllowStickersAndMemes (true/false)
    • AllowCustomMemes (true/false)
  9. Output and Export
    • Results are shown in a clean table format.
    • Users are prompted to export the data to CSV.

Further Enhancements

Enhancement Description
Add logging Save skipped or failed Teams to a separate log file.
Add team visibility Include whether a Team is Private or Public.
Add validation Skip or flag teams missing required settings.
Combine with other reports Merge with MessagingSettings, GuestSettings, etc.
Add execution timer Useful for large tenants to measure performance.

Possible Errors & Solutions

Error Cause Solution
Module Not Found Graph PowerShell not installed properly. Run Install-Module Microsoft.MGGraph -Scope CurrentUser and Install Graph PowerShell
FunSettings always return true Incorrect property access (partial data). Fixed by fetching each team’s full object using Get-MgTeam -TeamId.
Access Denied Missing Graph permissions. Run Connect-MgGraph -Scopes Team.Read.All with the proper permissions.
Export failed Invalid file path or locked file. Ensure path exists and the file isn’t open elsewhere.

Frequently Asked Questions

  • What does AllowGiphy control?
  • It enables or disables GIF search and usage via the Giphy integration in Teams.

  • What are the valid values for GiphyContentRating?
  • moderate (default)

    strict (limits inappropriate content)

  • Can I apply a filter to see only Teams where Giphy is disabled?
  • Yes, add this line after the loop:

    $results | Where-Object { $_.AllowGiphy -eq $false } | Format-Table -AutoSize
  • Where can I get the Team IDs manually?
  • You can run:

    Get-MgTeam | Select-Object Id, DisplayName
  • Is this script safe to run repeatedly?
  • Yes. It is read-only and does not make any changes to Teams.


Conclusion

This script gives Microsoft 365 admins a reliable and easy way to audit Teams Fun Settings across the organization using Microsoft Graph PowerShell. With its interactive export capability and robust error handling, it fits well into both manual auditing and automated governance tasks.

Whether you're performing a routine compliance check or preparing for a policy update, this script will save time and increase visibility across your tenant.


Graph PowerShell Explorer Widget

20 Graph PowerShell cmdlets with easily accessible "working" examples.


Permission Required

Example:


                


                


                

© m365corner.com. All Rights Reserved. Design by HTML Codex