Managing Microsoft 365 Groups is a crucial part of maintaining organizational structure, access controls, and communication workflows. Whether you're rebranding teams, updating descriptions, or controlling visibility, the Update-MgGroup cmdlet in Microsoft Graph PowerShell makes these tasks quick and efficient.
In this blog, we'll walk you through what Update-MgGroup does, why it's useful, its syntax, real-world usage examples, and frequently asked questions.
Update-MgGroup is a Microsoft Graph PowerShell cmdlet used to modify the properties of Microsoft 365 Groups. This includes attributes such as display name, description, visibility (public/private), mail settings, and more.
Here’s why Update-MgGroup is essential for Microsoft 365 administrators:
Update-MgGroup -GroupId <String> [-DisplayName <String>] [-Description <String>] [-MailNickname <String>] [-Visibility <String>] [-SecurityEnabled <Boolean>] [-MailEnabled <Boolean>] [-WhatIf] [-Confirm]
You can also use the -BodyParameter switch with a hashtable to update multiple properties at once.
Note:-BodyParameter is not required for simple updates to one or two fields. However, it's recommended for grouped or dynamic updates, especially in loops or bulk scenarios.
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" ` -DisplayName "New Group Name" `-Description "Updated group description"
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" -Visibility Private
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" `-MailEnabled $true `-SecurityEnabled $false
Let’s say you want to update the descriptions and visibility of multiple groups.
Sample CSV (groups.csv):
GroupId,DisplayName,Description,Visibility
11111111-1111-1111-1111-111111111111,Team Alpha,Core dev team,Private
22222222-2222-2222-2222-222222222222,Marketing Hub,Campaigns and Outreach,Public
Script:
# Import CSV file
$groups = Import-Csv -Path "C:\Path\To\groups.csv"
# Loop through and update each group
foreach ($group in $groups) {
try {
$params = @{
DisplayName = $group.DisplayName
Description = $group.Description
Visibility = $group.Visibility
}
Update-MgGroup -GroupId $group.GroupId -BodyParameter $params
Write-Host "Updated group: $($group.DisplayName)"
}
catch {
Write-Host "Failed to update group: $($group.DisplayName). Error: $_"
}
}
The Update-MgGroup cmdlet is a powerful, flexible way to manage and maintain Microsoft 365 Groups using Graph PowerShell. Whether you’re making small tweaks or automating large updates, this cmdlet helps keep your environment clean, secure, and up to date.
Take advantage of Microsoft Graph’s power and future-proof your group management workflows—start with Update-MgGroup today!
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