PowerShell Logo Small

Get-ADGroup



This is the built-in help made by Microsoft for the command 'Get-ADGroup', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets one or more Active Directory groups.

SYNTAX


Get-ADGroup [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Properties <String[]>] [-ResultPageSize <Int32>] [-ResultSetSize <Int32>]
[-SearchBase <String>] [-SearchScope <ADSearchScope>] [-Server <String>] -Filter <String> [<CommonParameters>]
Get-ADGroup [-Identity] <ADGroup> [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Partition <String>] [-Properties <String[]>]
[-Server <String>] [<CommonParameters>]
Get-ADGroup [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Properties <String[]>] [-ResultPageSize <Int32>] [-ResultSetSize <Int32>]
[-SearchBase <String>] [-SearchScope <ADSearchScope>] [-Server <String>] -LDAPFilter <String> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-ADGroup cmdlet gets a group or performs a search to retrieve multiple groups from an Active Directory.


The Identity parameter specifies the Active Directory group to get. You can identify a group by its distinguished name (DN), GUID, security
identifier (SID), Security Accounts Manager (SAM) account name, or canonical name. You can also specify group object variable, such as
$<localGroupObject>.


To search for and retrieve more than one group, use the Filter or LDAPFilter parameters. The Filter parameter uses the PowerShell Expression
Language to write query strings for Active Directory. PowerShell Expression Language syntax provides rich type conversion support for value
types received by the Filter parameter. For more information about the Filter parameter syntax, see about_ActiveDirectory_Filter. If you have
existing LDAP query strings, you can use the LDAPFilter parameter.


This cmdlet gets a default set of group object properties. To get additional properties use the Properties parameter. For more information
about the how to determine the properties for group objects, see the Properties parameter description.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219302
New-ADGroup
Remove-ADGroup
Set-ADGroup

REMARKS

<

Examples


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

C:\PS>Get-ADGroup administrators


DistinguishedName : CN=Administrators,CN=Builtin,DC=Fabrikam,DC=com
GroupCategory : Security
GroupScope : DomainLocal
Name : Administrators
ObjectClass : group
ObjectGUID : 02ce3874-dd86-41ba-bddc-013f34019978
SamAccountName : Administrators
SID : S-1-5-32-544



Description

-----------

Get the group with samAccountName administrators.




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

C:\PS>get-adgroup -Identity S-1-5-32-544 -Properties member


DistinguishedName : CN=Administrators,CN=Builtin,DC=Fabrikam,DC=com
GroupCategory : Security
GroupScope : DomainLocal
member : {CN=Domain Admins,CN=Users,DC=Fabrikam,DC=com, CN=Enterprise Admins,CN=Users,DC=Fabrikam,DC=com,
CN=LabAdmin,CN=Users,DC=Fabrikam,DC=com, C
N=Administrator,CN=Users,DC=Fabrikam,DC=com}
Name : Administrators
ObjectClass : group
ObjectGUID : 02ce3874-dd86-41ba-bddc-013f34019978
SamAccountName : Administrators
SID : S-1-5-32-544



Description

-----------

Get the group with SID S-1-5-32-544 including the additional property member.




-------------------------- EXAMPLE 3 --------------------------

C:\PS>get-adgroup -Filter 'GroupCategory -eq "Security" -and GroupScope -ne "DomainLocal"'



Description

-----------

Get all groups that have a GroupCategory of Security but do not have a GroupScope of DomainLocal.




-------------------------- EXAMPLE 4 --------------------------

C:\PS>get-adgroup -server localhost:60000 -filter {GroupScope -eq "DomainLocal"} -SearchBase "DC=AppNC"

DistinguishedName : CN=AlphaGroup,OU=AccountDeptOU,DC=AppNC
GroupCategory : Security
GroupScope : DomainLocal
Name : AlphaGroup
ObjectClass : group
ObjectGUID : 6498c9fb-7c62-48fe-9972-1461f7f3dec2
SID : S-1-510474493-936115905-2475435479-1276657127-1006239422-938965137

DistinguishedName : CN=BranchOffice1,OU=AccountDeptOU,DC=AppNC
GroupCategory : Security
GroupScope : DomainLocal
Name : BranchOffice1
ObjectClass : group
ObjectGUID : 0b7504c5-482b-4a73-88f5-8a76960e4568
SID : S-1-510474493-936115905-2534227223-1194883713-3669005192-3746664089

DistinguishedName : CN=AccountLeads,OU=AccountDeptOU,DC=AppNC
GroupCategory : Distribution
GroupScope : DomainLocal
Name : AccountLeads
ObjectClass : group
ObjectGUID : b20c032b-2de9-401a-b48c-341854a37254
SID : S-1-510474493-936115905-2813670187-1179675302-2001457839-270172950



Description

-----------

Get all the DomainLocal groups from the AppNC partition of the AD LDS instance.