Bird
0
0

Why does the Add-LocalGroupMember cmdlet not add duplicate users to a group?

hard📝 Conceptual Q10 of 15
PowerShell - Active Directory
Why does the Add-LocalGroupMember cmdlet not add duplicate users to a group?
ABecause it checks existing members and skips duplicates silently
BBecause PowerShell throws an error on duplicates
CBecause the group membership is stored in a database that forbids duplicates
DBecause the cmdlet removes all members before adding new ones
Step-by-Step Solution
Solution:
  1. Step 1: Understand cmdlet behavior

    Add-LocalGroupMember throws an error if the user is already a member.
  2. Step 2: Explain duplicate handling

    PowerShell checks existing members and throws an error on duplicates to prevent addition.
  3. Final Answer:

    Because PowerShell throws an error on duplicates -> Option B
  4. Quick Check:

    Duplicate add = throws error [OK]
Quick Trick: Add-LocalGroupMember throws error on duplicates [OK]
Common Mistakes:
  • Thinking it skips duplicates silently
  • Thinking duplicates are created
  • Assuming cmdlet clears members before adding

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes