Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What cmdlet is used to create a new local group in PowerShell?
The cmdlet <code>New-LocalGroup</code> is used to create a new local group on a Windows machine.
Click to reveal answer
beginner
How do you add a user to a local group using PowerShell?
Use Add-LocalGroupMember -Group <GroupName> -Member <UserName> to add a user to a local group.
Click to reveal answer
beginner
What cmdlet lists all members of a local group?
The cmdlet <code>Get-LocalGroupMember -Group <GroupName></code> lists all members of the specified local group.
Click to reveal answer
beginner
How can you remove a user from a local group in PowerShell?
Use Remove-LocalGroupMember -Group <GroupName> -Member <UserName> to remove a user from a local group.
Click to reveal answer
intermediate
What is the difference between a local group and a domain group?
A local group exists only on a single computer and manages permissions on that machine. A domain group is managed centrally in Active Directory and can control access across multiple computers in a network.
Click to reveal answer
Which cmdlet creates a new local group in PowerShell?
ANew-LocalGroup
BAdd-LocalGroupMember
CGet-LocalGroupMember
DRemove-LocalGroupMember
✗ Incorrect
New-LocalGroup creates a new local group. The others manage members.
How do you add a user named 'Alice' to a group named 'Admins'?
ANew-LocalGroup -Group Admins -Member Alice
BAdd-LocalGroupMember -Group Admins -Member Alice
CGet-LocalGroupMember -Group Admins -Member Alice
DRemove-LocalGroupMember -Group Admins -Member Alice
✗ Incorrect
Add-LocalGroupMember adds a user to a group.
Which cmdlet shows all members of a local group?
AGet-LocalGroupMember
BAdd-LocalGroupMember
CNew-LocalGroup
DRemove-LocalGroupMember
✗ Incorrect
Get-LocalGroupMember lists group members.
What cmdlet removes a user from a local group?
AAdd-LocalGroupMember
BGet-LocalGroupMember
CNew-LocalGroup
DRemove-LocalGroupMember
✗ Incorrect
Remove-LocalGroupMember removes a user from a group.
Which statement is true about domain groups?
AThey cannot be managed with PowerShell.
BThey exist only on a single computer.
CThey manage permissions across multiple computers in a network.
DThey are the same as local groups.
✗ Incorrect
Domain groups control access across many computers in a network.
Explain how to create a local group and add a user to it using PowerShell.
Think about the cmdlets that manage groups and members separately.
You got /3 concepts.
Describe the difference between local groups and domain groups.
Consider where the groups are managed and their scope.
You got /3 concepts.
Practice
(1/5)
1. Which PowerShell cmdlet is used to create a new local group on a Windows machine?
easy
A. Add-LocalGroupMember
B. Get-LocalGroupMember
C. New-LocalGroup
D. Remove-LocalGroup
Solution
Step 1: Understand the purpose of each cmdlet
New-LocalGroup creates a new group, Add-LocalGroupMember adds users to a group, Get-LocalGroupMember lists members, Remove-LocalGroup deletes a group.
Step 2: Identify the cmdlet for creating groups
Only New-LocalGroup is used to create a new local group.
2. Which of the following is the correct syntax to add a user named 'Alice' to a local group called 'Developers'?
easy
A. Add-LocalGroupMember -Group 'Developers' -Member 'Alice'
B. Add-LocalGroupMember -Member 'Developers' -Group 'Alice'
C. New-LocalGroup -Group 'Developers' -Member 'Alice'
D. Get-LocalGroupMember -Group 'Developers' -Member 'Alice'
Solution
Step 1: Identify the cmdlet to add members
Add-LocalGroupMember is used to add users to groups.
Step 2: Check parameter order and names
The correct syntax uses -Group for the group name and -Member for the user name.
Final Answer:
Add-LocalGroupMember -Group 'Developers' -Member 'Alice' -> Option A
Quick Check:
Add user syntax = Add-LocalGroupMember -Group -Member [OK]
Hint: Group comes before Member in Add-LocalGroupMember [OK]
Common Mistakes:
Swapping -Group and -Member parameters
Using New-LocalGroup to add members
Using Get-LocalGroupMember to add members
3. What will be the output of this PowerShell command if the 'TestGroup' has members 'Bob' and 'Carol'?
Get-LocalGroupMember -Group 'TestGroup' | Select-Object -ExpandProperty Name
medium
A. Bob
Carol
B. Name
Bob
Carol
C. TestGroup
D. Error: Group not found
Solution
Step 1: Understand Get-LocalGroupMember output
This cmdlet lists members of the specified group with properties like Name.
Step 2: Effect of Select-Object -ExpandProperty Name
This extracts only the Name property values, outputting member names as plain strings.
Final Answer:
Bob
Carol -> Option A
Quick Check:
Extracted names list = Bob and Carol [OK]
Hint: Select -ExpandProperty outputs only the property values [OK]
Common Mistakes:
Expecting property headers in output
Confusing group name with member names
Assuming error if group exists
4. You run this command but get an error: Add-LocalGroupMember -Group 'Admins' -Member 'John'. What is the most likely cause?
medium
A. The syntax is incorrect
B. The 'Admins' group does not exist
C. The 'John' user is already a member
D. You are not running PowerShell as administrator
Solution
Step 1: Check permissions needed for group changes
Modifying local groups requires administrator privileges in PowerShell.
Step 2: Analyze error cause
If the group exists and syntax is correct, lack of admin rights causes permission errors.
Final Answer:
You are not running PowerShell as administrator -> Option D
Quick Check:
Admin rights needed for group changes [OK]
Hint: Always run PowerShell as admin for group management [OK]
Common Mistakes:
Assuming syntax error without checking permissions
Ignoring admin rights requirement
Thinking user membership causes error
5. You want to create a new local group named 'ProjectTeam' and add multiple users: 'Alice', 'Bob', and 'Carol'. Which script correctly does this in PowerShell?
B. New-LocalGroup -Name 'ProjectTeam'; Add-LocalGroupMember -Group 'ProjectTeam' -Member 'Alice','Bob','Carol'
C. New-LocalGroup -Name 'ProjectTeam' -Member 'Alice','Bob','Carol'
D. New-LocalGroup -Group 'ProjectTeam'; Add-LocalGroupMember -Member 'Alice','Bob','Carol'
Solution
Step 1: Create the group first
Use New-LocalGroup with -Name to create 'ProjectTeam'.
Step 2: Add multiple members in one command
Add-LocalGroupMember accepts multiple members as a comma-separated list.
Step 3: Verify syntax correctness
New-LocalGroup -Name 'ProjectTeam'; Add-LocalGroupMember -Group 'ProjectTeam' -Member 'Alice','Bob','Carol' correctly creates the group then adds all members in one command.