How to add members to office 365 group using powershell

Опубликовано: 01 Июль 2026
на канале: IT Champions
115
3

In this video we will learn How to add members to office 365 group using powershell

Connect-MgGraph -scopes "user.readwrite.all, group.readwrite.all"

Get-MgGroup

$group = Get-MgGroup | Where-Object {$_.DisplayName -eq "marketing"}

$user = Get-MgUser | Where-Object {$_.DisplayName -eq "shabir"}

New-MgGroupMember -GroupId $group.Id -DirectoryObjectId $user.Id

Get-MgGroupMember -GroupId $group.Id | FL