What it is
A PowerShell sample that reads a CSV of Microsoft 365 group IDs and user email addresses and adds each user as an owner of the group behind a Viva Engage community by calling Microsoft Graph. Group owners are treated as admins of the associated community.
Why use it
- Add community admins in bulk instead of one community at a time.
- Uses the documented Microsoft Graph group owners API with app-only authentication and waits and retries when Graph throttles requests.
- Prints a success or failure message for every CSV row.
How to use it
- Create a Microsoft Entra app registration with the Microsoft Graph
Group.ReadWrite.Allapplication permission and grant admin consent. - Create a CSV with a
GroupIDcolumn (the Microsoft 365 group ID behind the community) and anEmailcolumn (the UPN of the user to make an admin). - Set
$groupadminsCsvPath,$ClientId,$TenantId, and$ClientSecretnear the top of the script. - Run:
.\Add-EngageGroupAdmins.ps1Prerequisites
- Microsoft Entra app registration with the Group.ReadWrite.All application permission and admin consent
- CSV with GroupID and Email columns; GroupID is the Microsoft 365 group GUID, not the legacy numeric Yammer group ID