Find Active Directory groups with Get-ADGroup search filter

30 March,2020 by Jack Vamvas

Question: How can I find a list of AD groups with a specific search filter on the name column. ?   In this case I want to find all AD groups in the default OU group with a search string.

Answer: Assuming you are in the current Domain group \ OU group , find an example of Get-ADGroup which will filter on the search string "admin"

Get-ADGroup -Filter "name -like '*admin*'" -Properties * | select name

 

if you need to commit the Get_ADgroup search onto another server - than you'll need to use the -server switch

Get-ADGroup -Filter "name -like '*admin'" -Properties  -server "server2.net" | select name

 

The Get-ADGroup is part of other related AD-Group powershell cmdlets.

Get-ADgroup

 

 

Read more on Powershell and Active Directory searches

How to get DOMAIN login name with Powershell Get-ADGroupMember

How to Export Active Directory Group Members with Powershell Get-ADGroupMember 


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on Find Active Directory groups with Get-ADGroup search filter


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer