Question:
I have been searching everywhere, and have tried many different combinations, but I can’t seem to figure out how to get the “Job title” from the organization part of AD.
Here are a few things that I have tried
1 2 3 4 |
get-aduser -Filter * -SearchBase "Bob.Barker" -Properties sAMAccountName,Title Get-ADUser -identity "Bob.Barker" -Filter * -Properties title | group title -NoElement |
Also, as a bonus question how would you set the job title.
Thank you all for your assistance.
Answer:
In your example, if the user’s username is Bob.Barker then use this:
1 2 |
get-aduser -Filter {samAccountName -eq "Bob.Barker"} -Properties sAMAccountName,Title |
or if surname is Barker
1 2 |
get-aduser -Filter {sn -eq "Barker"} -Properties sAMAccountName,Title |