Searching and modifying group object information

Searching Active Directory for the presence of a group is similar to searching users and groups. A cmdlet called Get-ADGroup from the Active Directory module can be used to get group object information.

For example, we can use the following command to get display names of all groups in Active Directory:

Get-ADGroup -Filter * | select Name

By specifying asterisk (*) as an argument to the -Filter parameter, we are querying all groups in Active Directory and then displaying the value of the Name property using the select statement.

To search for a specific group by name, we can pass the name of the group to the -Filter parameter, as shown in the following command:

Get-ADGroup -Filter "Name -eq 'Test ...

Get Active Directory with PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.