Question 46 — AB-650 Case Study Set
Paideffort's group-membership script reconnects to Microsoft Graph before adding every one of the eight employees to the Overseas-Office group. Which design improvement best supports the future requirement to process larger batches efficiently? (Select one answer)
Connect once with
GroupMember.ReadWrite.All, then iterate through the employee records and perform the membership operations within that authenticated session.Request
Directory.ReadWrite.Allfor each employee so individual connections complete more quickly because the scope is broader.Create a separate PowerShell process for every employee so all users authenticate independently before membership assignment.
Replace the CSV with portal-based group membership because Graph PowerShell should not be used for repeated membership changes.
Correct answers
Connect once with
GroupMember.ReadWrite.All, then iterate through the employee records and perform the membership operations within that authenticated session.
Explanations
Correct Answer:
Connect once with GroupMember.ReadWrite.All, then iterate through the employee records and perform the membership operations within that authenticated session.
Explanation:
Paideffort wants scripts to avoid unnecessary interactive reconnections as its batches grow. The connection establishes the required Graph permissions for the session, so reconnecting for every employee adds overhead without improving the group-membership operation. One appropriately scoped connection can support the complete loop.
Wrong Answers:
Request Directory.ReadWrite.All for each employee so individual connections complete more quickly because the scope is broader.
A broader permission does not solve the repeated-connection design and conflicts with Paideffort's least-privilege requirement.
Create a separate PowerShell process for every employee so all users authenticate independently before membership assignment.
This increases the authentication and execution overhead that Paideffort wants to remove from large batch operations.
Replace the CSV with portal-based group membership because Graph PowerShell should not be used for repeated membership changes.
Paideffort specifically requires scalable, repeatable bulk administration, and New-MgGroupMemberByRef is part of its scripted group-membership architecture.