Roccat
asked on
List title next to name in listbox
Can you help me how a users job title next to their name in a list box? The code below lists all users in one OU. I would like to list their job title from the job title field next to their name but cant figure out how.
$listbox3.Items.Clear();
$here3 = Get-ADUser -SearchBase "OU=Staff,OU=Amigos,dc=homelab,dc=com" -Filter * | Get-ADUser -Property DisplayName, title | Select -expandproperty Name
$here3 = $here3 | sort-object
load-listbox -Listbox $listbox3 -Items $here3
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I created a GUI using poweshell studio with a listbox element that gets populated with the code above. I am not sure how to utilize the gridview and also could not figure out how to use the columns mentioned above. Perhaps this is not something I can figure out with at this time.
ASKER
Thank you for the tip about not stressing the ad with multiple get-user requests.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And there's no need to stress AD by calling Get-ADUser twice.
Open in new window
When used with -PassThru, it can even be used to let a user select one (-OutputMode Single) or multiple (-OutputMode Multiple) items from the list.