How to Use New-MgGroupOwner to Add Microsoft 365 Group Owners?

When managing Microsoft 365 Groups, it’s essential to assign ownership to ensure proper access, lifecycle management, and accountability. The New-MgGroupOwner cmdlet in Microsoft Graph PowerShell makes this task effortless by letting you programmatically assign owners to Microsoft 365 Groups — whether it's one owner, many owners, or importing from a CSV file.

In this blog, we'll explore the New-MgGroupOwner cmdlet with real-world examples and use cases.


What is New-MgGroupOwner?

New-MgGroupOwner is a cmdlet from the Microsoft Graph PowerShell SDK that lets you add owners to existing Microsoft 365 Groups. Owners are privileged members who can manage group settings, approve join requests, and remove members.


Why Use New-MgGroupOwner?

Using New-MgGroupOwner offers many benefits:

  • Automation: Add one or many owners with a script.
  • Bulk Assignment: Import data from CSVs and assign owners in bulk.
  • Consistency: Maintain uniform owner assignment across your organization.
  • Efficiency: Avoid repetitive manual steps through scripts.

Cmdlet Syntax

New-MgGroupOwner -GroupId <String> -DirectoryObjectId <String> [-Confirm]

  • GroupId is the unique identifier of the Microsoft 365 group.
  • DirectoryObjectId is the unique identifier of the user you want to assign as owner.

Usage Examples

Adding a Single Owner to a Group

$groupId = "12345abc-678d-90ef-ghij-klmnopqrstuv"
$directoryObjectId = "98765zyx-432w-vuts-rqpo-nmlkjihgfedc"
                                            
New-MgGroupOwner -GroupId $groupId -DirectoryObjectId $directoryObjectId
                                        

Adding Multiple Owners to a Group

$groupId = "12345abc-678d-90ef-ghij-klmnopqrstuv"
$directoryObjectIds = @(
    "98765zyx-432w-vuts-rqpo-nmlkjihgfedc",
    "abcdef12-3456-7890-abcd-efghijklmnop"
)
                                            
foreach ($directoryObjectId in $directoryObjectIds) {
    New-MgGroupOwner -GroupId $groupId -DirectoryObjectId $directoryObjectId
}
                                        

Adding Owner with Confirmation Prompt

$groupId = "12345abc-678d-90ef-ghij-klmnopqrstuv"
$directoryObjectId = "98765zyx-432w-vuts-rqpo-nmlkjihgfedc"
                                            
New-MgGroupOwner -GroupId $groupId -DirectoryObjectId $directoryObjectId -Confirm
                                        

Importing Group Owners from a CSV File

$csvPath = "C:\\path\\to\\your\\file.csv"
$groupOwners = Import-Csv -Path $csvPath
                                            
foreach ($owner in $groupOwners) {
    New-MgGroupOwner -GroupId $owner.GroupId -DirectoryObjectId $owner.DirectoryObjectId
}
                                        

CSV File Structure

GroupId,DirectoryObjectId
12345abc-678d-90ef-ghij-klmnopqrstuv,98765zyx-432w-vuts-rqpo-nmlkjihgfedc
12345abc-678d-90ef-ghij-klmnopqrstuv,abcdef12-3456-7890-abcd-efghijklmnop

Frequently Asked Questions

How do I find the GroupId of a Microsoft 365 Group?

You can use:

Get-MgGroup -Filter "displayName eq 'Group Name'" | Select-Object Id, DisplayName

What is a DirectoryObjectId?

It’s the Object ID of a user or service principal. Use:

Get-MgUser -UserId user@domain.com | Select-Object Id

Can I assign an external user as an owner?

Only if they’ve been invited and accepted as guests in your directory. Owners must exist in Azure AD.


Use Cases

  • Assign multiple owners during group creation workflows.
  • Fix misconfigured groups missing owners.
  • Mass assign owners for all existing Microsoft 365 groups.
  • Import ownership data from HR systems or CSVs.

Conclusion

Managing Microsoft 365 Groups efficiently means assigning the right owners who can handle administrative tasks. The New-MgGroupOwner cmdlet gives you full control over ownership assignments via scripting — whether you're adding one owner or a hundred.


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