Book Image

Active Directory with PowerShell

By : Pamarthi Venkata Sitaram, YELLAPRAGADA U PADMAVATHI
5 (1)
Book Image

Active Directory with PowerShell

5 (1)
By: Pamarthi Venkata Sitaram, YELLAPRAGADA U PADMAVATHI

Overview of this book

Table of Contents (16 chapters)
Active Directory with PowerShell
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 Group1'"

This command searches Active Directory for groups with the name that exactly matches Test Group1 and returns the group object if present; otherwise, no output is seen.

There is another parameter that helps in performing the search operation...