Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.
🚀 Launch ToolkitKeeping track of Microsoft 365 group owners is essential for delegation clarity, compliance audits, and efficient governance. But when you’re managing a large number of Microsoft 365 Groups—especially Unified Groups—doing it manually is both time-consuming and error-prone. In this guide, we’ll show you how to automate the generation and emailing of a Microsoft 365 Unified Group Owners Report using Graph PowerShell.
Microsoft 365 Unified Groups are collaborative objects that combine features from Outlook, SharePoint, Teams, Planner, and more. Each Unified Group has one or more owners—users responsible for managing group membership, settings, and oversight. These owners act as administrators for their respective groups.
Identifying and tracking these owners is crucial for internal audits, compliance requirements, and avoiding orphaned groups that have no active manager.
Here’s why scripting this report is not just useful—but essential:
Here’s a complete script that:
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "Group.Read.All", "User.Read.All", "Mail.Send"
# Define admin mailbox to send report
$adminEmail = "samadmin@7xh7fj.onmicrosoft.com" # Replace with your actual admin email
$fromUser = "samadmin@7xh7fj.onmicrosoft.com" # The mailbox from which the email will be sent
# Fetch all Unified Groups
$groups = Get-MgGroup -All -Property Id, DisplayName, GroupTypes | Where-Object {
$_.GroupTypes -contains "Unified"
}
Write-Host "Found $($groups.Count) unified groups. Collecting owners..." -ForegroundColor Cyan
# Build HTML table (escaped for documentation)
$html = "<html><body>"
$html += "<h3>Microsoft 365 Group Owners Report</h3>"
$html += "<table border='1' cellpadding='5' cellspacing='0'>"
$html += "<tr><th>Group Name</th><th>Owner Name</th><th>Owner Email</th></tr>"
foreach ($group in $groups) {
$owners = Get-MgGroupOwner -GroupId $group.Id -ErrorAction SilentlyContinue
if ($owners) {
foreach ($owner in $owners) {
$ownerName = $owner.AdditionalProperties.displayName
$ownerEmail = $owner.AdditionalProperties.mail
$html += "<tr><td>$($group.DisplayName)</td><td>$ownerName</td><td>$ownerEmail</td></tr>"
}
} else {
$html += "<tr><td>$($group.DisplayName)</td><td colspan='2'>No owner assigned</td></tr>"
}
}
$html += "</table></body></html>"
# Construct the email body
$emailBody = @{
Message = @{
Subject = "Microsoft 365 Group Owners Report"
Body = @{
ContentType = "HTML"
Content = $html
}
ToRecipients = @(
@{
EmailAddress = @{
Address = $adminEmail
}
}
)
}
SaveToSentItems = $true
}
# Send the email
Send-MgUserMail -UserId $fromUser -BodyParameter $emailBody
Write-Host "`nâś… Group owner report emailed to $adminEmail" -ForegroundColor Green
Here are some common issues you might face and how to fix them:
Error | Cause | Fix |
---|---|---|
Access Denied | Missing Graph API permissions | Ensure you’ve granted and consented to the required scopes (Group.Read.All, User.Read.All, Mail.Send) |
Send-MgUserMail fails | The fromUser mailbox is not provisioned | Make sure the sender mailbox is licensed and active |
Empty report | You don’t have any Unified Groups or script filtered out all others | Double-check group types using `Get-MgGroup. |
Automating Microsoft 365 Unified Group ownership reporting can greatly reduce administrative burden and support compliance initiatives. This PowerShell script lets you efficiently identify group owners and receive an HTML report directly via email—turning a tedious task into a one-click solution.
With Microsoft Graph PowerShell and a little automation, managing your M365 environment becomes both smarter and simpler.
Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.
Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.
© Your Site Name. All Rights Reserved. Design by HTML Codex