July 21st, 2014

PowerTip: Find List of Users in Active Directory

Doctor Scripto
Scripter

Summary: Use the Filter parameter in the Active Directory module.

Hey, Scripting Guy! Question I was playing with the Active Directory cmdlets and noticed that they seem to need the Distinguished Name.
           Is there any way to find users instead of supplying this very explicit object each time?

Hey, Scripting Guy! Answer Use the –Filter parameter to pull the information. For example, to find all users with the last name Smith,
           specify the Surname attribute with the –Filter parameter:

GET-ADUser –filter 'Surname –eq "Smith"' 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.