I have a list of users that I need to pull information from AD and then output to a file. I am having trouble with a couple of things.
1. How do I import this list of users from a txt file and then cycle through this list. This is what I have, but I can't get the $users variable to work properly.
$users=Import-csvC:\users.txt
Get-ADUser$users-PropertiesTitle,Manager|selectTitle,Manager
If I just run just this line, like so it outputs this information.
Get-ADUser test.user-PropertiesTitle,Manager|selectTitle,Manager
Title Manager
----- -------
IT TestUser fulldistinguishedLDAPname
I figured out how to output only the name of the manager, but then I loose the title.
Get-ADUsertest.user-PropertiesTitle,Manager|%{(Get-AdUser$_.Manager-PropertiesName).Name}
IT Test Manager
How do I combined all of this to make a functional script? Thank you!