Example 4: Get a group from a specified search base and filter the results PS C:\> Get-ADGroup -Server localhost:60000 -Filter "GroupScope -eq 'DomainLocal'" -SearchBase "DC=AppNC"ĭistinguishedName : CN=AlphaGroup,OU=AccountDeptOU,DC=AppNC This command gets all groups that have a GroupCategory of Security but do not have a GroupScope of DomainLocal. Example 3: Get a group and filter the results PS C:\> Get-ADGroup -Filter 'GroupCategory -eq "Security" -and GroupScope -ne "DomainLocal"' This command gets the group with SID S-1-5-32-544 and the property member. Example 2: Get a group by SID PS C:\> Get-ADGroup -Identity S-1-5-32-544 -Properties member This command gets the group with the SAM account name Administrators. Examples Example 1: Get a group by SAM account name PS C:\> Get-ADGroup -Identity AdministratorsĭistinguishedName : CN=Administrators,CN=Builtin,DC=Fabrikam,DC=com To get additional properties use the Properties parameter.įor more information about the how to determine the properties for group objects, see the Properties parameter description. This cmdlet gets a default set of group object properties. If you have existing Lightweight Directory Access Protocol (LDAP) query strings, you can use the LDAPFilter parameter. PowerShell Expression Language syntax provides rich type conversion support for value types received by the Filter parameter.įor more information about the Filter parameter syntax, type Get-Help about_ActiveDirectory_Filter. The Filter parameter uses the PowerShell Expression Language to write query strings for Active Directory. To search for and retrieve more than one group, use the Filter or LDAPFilter parameters. You can also specify group object variable, such as $. You can identify a group by its distinguished name (DN), GUID, security identifier (SID), or Security Accounts Manager (SAM) account name. The Identity parameter specifies the Active Directory group to get. The Get-ADGroup cmdlet gets a group or performs a search to retrieve multiple groups from an Active Directory. Gets one or more Active Directory groups.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |