Managing Microsoft 365 groups often requires administrators to make updates such as changing names, modifying mail settings, or adjusting visibility. With Microsoft Graph PowerShell, the Update-MgGroup cmdlet makes these updates easy, reliable, and scriptable.
In this article, you’ll learn four practical and beginner-friendly scripts using Update-MgGroup to update different aspects of Microsoft 365 groups. Each example shows exactly how to use the cmdlet and includes simple explanations to help you understand what the script does.
Before running any of the following scripts, install and connect to Microsoft Graph PowerShell:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Group.ReadWrite.All"
Once connected, you're ready to update your groups.
You should pass in the new display name and description along with Group ID.
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" -DisplayName "New Group Name" -Description "Updated group description"
Explanation:
This script updates both the name and description of a Microsoft 365 group. It’s useful when a team undergoes rebranding, organizational changes, or when descriptions need clarifying.
You should pass in the new group visibility along with Group ID.
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" -Visibility Private
Explanation:
This updates the group’s visibility to Private, meaning only approved members can view the group’s content. Perfect for confidential or internal teams.
To change the mail nickname (alias) of a Microsoft 365 group, execute:
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" -MailNickname "NewAlias"
Explanation:
The mail nickname determines the email alias of the group.
This script is especially useful after renaming departments, teams, or distribution lists.
To configure a group's mail-enabled and security-enabled settings, use:
Update-MgGroup -GroupId "12345678-90ab-cdef-1234-567890abcdef" -MailEnabled $true -SecurityEnabled $false
Explanation:
This script turns the group into a mail-enabled group while disabling its security group functionality.
Useful scenarios include:
Get-MgGroup -GroupId <ID>
| Error | Cause | Solution |
| Insufficient privileges | Missing permissions | Use Connect-MgGraph -Scopes "Group.ReadWrite.All" |
| Request_BadRequest | Invalid value for DisplayName, MailNickname, or Visibility | Ensure values follow Microsoft 365 naming rules |
| Group not found | Wrong GroupId | Confirm with Get-MgGroup |
| Property is read-only | Trying to update unsupported attributes | Only update allowed properties |
The Update-MgGroup cmdlet is a powerful and flexible tool for managing Microsoft 365 group attributes. Whether you’re updating names, managing visibility, changing email aliases, or configuring mail/security settings, these scripts give you a strong foundation for day-to-day group administration.
As your PowerShell automation grows, you can combine these updates into larger workflows to streamline group management across your organization.
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