Hello all, i have a pretty simple script to return usernames based off of full names that are being read in by a text file. All is well regarding the script, however the output has some white space that im having difficulty getting rid of. Here is the script....
$users = get-content c:\users\user\desktop\names.txt
$results = foreach ($item in $Users) {get-aduser -filter {name -eq $item} | select-object samaccountname}
$results | out-file c:\users\user\desktop\results.txt
i have attached a screenshot of what the output actually looks like in a text file, you can see when i do a "select all" that theres a ton of white space after each result.