List AD user with Powershell

Any idea how to list out all active users in AD with title contain either Director or Manager ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ben HartCommented:
Pulling from memory, which might be spotty at this hour...

Get-adviser -filter * -properties title -eq director or
AXISHKAuthor Commented:
Doesn't work...

PS C:\Users\administrator.xxxxxx> Get-adviser -filter * -properties title -eq director
Get-adviser : The term 'Get-adviser' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-adviser -filter * -properties title -eq director
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-adviser:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Ben HartCommented:
Sorry I'm

Get-ad user -filter * (-properties title -eq "director" or "manager")
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Ben HartCommented:
Get-advisor isn't a comfort.. It's get-aduser

Sorry stupid autocorrect
In case you are still having trouble

Get-ADUser -Properties title -filter {title -eq 'manager' -or title -eq 'director'}

Open in new window

Bob McCoyCommented:
If you use the -eq operator, the match has to be exact.  In other words, "HR manager" would not be a match.  It is better to use the -like operator with wildcards on either side of the keyword.  That way "IT Director" and "Director of IT" both match.

Get-ADUser -Filter {Title -like "*Manager*" -or Title -like "*Director*"} -Properties title

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.