Bird
0
0

What will be the output of the following command if the group 'TestGroup' has members 'Alice' and 'Bob'?

medium📝 Command Output Q4 of 15
PowerShell - Active Directory
What will be the output of the following command if the group 'TestGroup' has members 'Alice' and 'Bob'?
Get-LocalGroupMember -Group 'TestGroup' | Select-Object -ExpandProperty Name
ATestGroup
BAlice Bob
CName Alice Bob
DError: Group not found
Step-by-Step Solution
Solution:
  1. Step 1: Understand the cmdlet and pipeline

    Get-LocalGroupMember -Group 'TestGroup' lists members of 'TestGroup'. The pipeline selects only the 'Name' property values.
  2. Step 2: Predict the output

    Since members are 'Alice' and 'Bob', the output will be their names listed line by line without headers.
  3. Final Answer:

    Alice Bob -> Option B
  4. Quick Check:

    Output = member names only [OK]
Quick Trick: Select-Object -ExpandProperty outputs values without headers [OK]
Common Mistakes:
  • Expecting headers in output
  • Confusing group name with member names
  • Assuming error when group exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes