Search Active Directory for Groups

Old 1 Comment on Search Active Directory for Groups 15

Greetings,

It really bugs me that Microsoft couldn’t have put wildcard search in “Active Driectory Users and Computers” tool. How many times have you left a space in a name when pasting and it never finds what your looking for? So, Powershell to the rescue, again. By using Get-ADGroup and a filter “LIKE” we can now use a wildcard to help find things. Here I wanted to see what AD groups were laying around, not being used. What time to clean up an old mess?? Don’t tell anyone now.

Get-ADGroup -Filter {name -like "*SMS*"} | Select-Object Name
  • Get-ADGroup will pull all the group information from AD
  • -Filter helps narrow down our search
  • name is the field we are looking in.
  • -like and the * wildcards helps us look everywhere
  • Select-Object Name will limit our results to just the group name
Enjoy!
-D3

Author

David D Dorsett

Specialties: System Engineer • GMP Validation • Networking • Windows/Linux • SCCM • Powershell

Related Articles

1 Comment

  1. Barry Jordan July 17, 2014 at 6:27 am

    Keeping your security groups in OUs is a best practice that you should employ to avoid this issue.

Leave a comment

Back to Top