Add-ADGroupMember
Use Add-ADGroupMember to add users, computers or other groups to an Active Directory group.
Documentation: Microsoft Learn — Add-ADGroupMember
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Add-ADGroupMember [-Identity] <ADGroup> [-Members] <ADPrincipal[]> [-Server <String>] [-Credential <PSCredential>] [-PassThru] [-WhatIf] [<CommonParameters>]- Stage 1Add-ADGroupMember
-Identity -Members -Server -Credential -PassThru -WhatIf
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Add-ADGroupMember -Identity "Sales-Read"
Show reference output
Sample output · fictional data, shaped like the real thing
Name SamAccountName objectClass ---- -------------- ----------- ajones ajones user jsmith jsmith user mchen mchen user
Get-ADGroupMember -Identity "Sales-Read"
Show reference output
Sample output · fictional data, shaped like the real thing
Count : 2 Average : Sum : Maximum : Minimum : Property :
Add-ADGroupMember -Identity "App-Users"
Show reference output
Sample output · fictional data, shaped like the real thing
Name SamAccountName objectClass ---- -------------- ----------- Sales-Read Sales-Read group jdoe jdoe user
Parameters
Parameter definitions:
-Identity-Members-Server-Credential-PassThru-WhatIf
Practical use and troubleshooting
Practical scenario: Use Add-ADGroupMember when you need to add users, computers or other groups to an Active Directory group. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: Access denied requires rights to change the target group's membership. Resolve both the group and member before the change and re-query membership after the operation. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Remove-ADGroupMember. Add-ADGroupMember adds membership links; Remove-ADGroupMember removes them. Review direct membership separately from effective access obtained through nested groups. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Add-ADGroupMember Use Add-ADGroupMember to add users, computers or other groups to an Active Directory group.
Next: Get-ADGroupMember