< Back

Get-ADGroupMembers

Fri Jan 10, 2020 7:01 pm

NAME Get-ADGroupMembers



SYNOPSIS

Gets the complete group membership of an AD group.





SYNTAX

Get-ADGroupMembers [[-Identity] <String>] [[-Domain] <String>] [-Credential <PSCredential>] [<CommonParameters>]





DESCRIPTION

The Get-ADNestedGroupMembers gets all nested group members of an AD group.





PARAMETERS

-Identity <String>

The identity of the AD group to get group members of. This is a string that is matched against AD object

properties:



-Name

-SamAccountName

-CN

-DistinguishedName

-Display Name

-ObjectSID

-ObjectGUID



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Domain <String>

Optionally indicates the domain the object exists in. If this parameter is not specified, the domain of the

local user or computer is used, depending on what is specified for

the Identity parameter.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

Specifies a user account that has permission to perform this action. The default is the current user.



Type a user name, such as "User01" or "Domain01\\User01", or enter a PSCredential object, such as one generated

by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.



Required? false

Position? named

Default value [System.Management.Automation.PSCredential]::Empty

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String





OUTPUTS

Microsoft.ActiveDirectory.Management.ADObject[]





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/7/2017



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ADGroupMembers -Identity Administrators



Gets all group members in the Administrators group.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ADGroupMembers -Identity "Domain Admins" -Domain root



Gets all group members for the Domain Admins group in the root domain. This command could be run from a different

domain that also

had a group named "Domain Admins".











RELATED LINKS