Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get organization Job title in AD using powershell

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

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.

like image 580
Radagast Avatar asked Dec 25 '22 03:12

Radagast


1 Answers

In your example, if the user's username is Bob.Barker then use this:

get-aduser -Filter {samAccountName -eq "Bob.Barker"}  -Properties sAMAccountName,Title

or if surname is Barker

get-aduser -Filter {sn -eq "Barker"}  -Properties sAMAccountName,Title
like image 65
Raf Avatar answered Jan 07 '23 05:01

Raf