external help file | Module Name | online version | schema |
---|---|---|---|
ADReportingTools-help.xml |
ADReportingTools |
2.0.0 |
Get user members of an AD group.
Get-ADGroupUser [-Name] <String> [-Server <String>] [-Credential <PSCredential>] [<CommonParameters>]
This command will display all users of a given Active Directory group. The search is automatically recursive. The default output is a formatted table that will highlight disabled accounts in red.
PS C:\> Get-ADGroupUser sales
DistinguishedName: CN=SamS,OU=Sales,DC=Company,DC=Pri [Sam Smith]
Name Title Description PasswordLastSet
---- ----- ----------- --------------
SamS Sales Staff 1/25/2021 1:32:36 PM
DistinguishedName: CN=SonyaS,OU=Sales,DC=Company,DC=Pri [Sonya Smith]
Name Title Description PasswordLastSet
---- ----- ----------- --------------
SonyaS Account Executive Sales 1/25/2021 1:32:37 PM
DistinguishedName: CN=SamanthaS,OU=Sales,DC=Company,DC=Pri [Samantha Smith]
Name Title Description PasswordLastSet
---- ----- ----------- --------------
SamanthaS Sales Assistant Sales Staff 1/25/2021 1:32:37 PM
Disabled accounts will have their distinguished name displayed in red.
PS C:\> Get-ADGroupUser sales | format-list
Group: CN=Sales,OU=Sales,DC=Company,DC=Pri
DistinguishedName : CN=SamS,OU=Sales,DC=Company,DC=Pri
Name : SamS
Displayname : Sam Smith
Description : Sales Staff
Title :
Department : Sales
Enabled : False
PasswordLastSet : 3/4/2021 4:03:23 PM
DistinguishedName : CN=SonyaS,OU=Sales,DC=Company,DC=Pri
Name : SonyaS
Displayname : Sonya Smith
Description : Sales
Title : Account Executive
Department : Sales
Enabled : True
PasswordLastSet : 1/25/2021 1:32:37 PM
...
Using the defined list view.
Specify an alternate credential.
Type: PSCredential
Parameter Sets: (All)
Aliases: RunAs
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter the name of an Active Directory group.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Specify a domain controller to query.
Type: String
Parameter Sets: (All)
Aliases: dc, domaincontroller
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/