QuestionQ37
Configure and manage Microsoft 365 tenants and workloadsYou have a Microsoft 365 subscription containing a security group named Group1. Its object ID is stored in the PowerShell variable $groupId.
A CSV file named C:\Temp\members.csv contains a column called memberObjectId, which stores the directory object ID of every user to add to Group1.
You need to carry out a bulk membership update for Group1 by using Microsoft Graph PowerShell. How should you complete the script?
Select
-Scopes "GroupMember.ReadWrite.All" $members = Import-Csv -Path "C:\Temp\members.csv" foreach ($member in $members) { -GroupId $groupId -OdataId "https://graph.microsoft.com/v1.0/directoryObjects/$($member.ObjectId)" } Disconnect-MgGraph
Community Discussion