Search for an Active Directory user or group with PowerShell
I actually don’t even care if I’m late to the game on this one.
I search AD for users a few times a month, and the syntax is so weird that I forget it every time I need to do it again. Annoying!
So here’s what it is:
get-aduser -FilterĀ {name -like “*dave*”}
It also works for AD Groups:
Get-ADGroup -Filter {name -like “*vdi*”}
I hope this helps- I did this for me, not for you ;).
If you’re a PowerShell maven and you’re in it all day long, you won’t need this. Thanks for stopping by and check out some more of my stuff!