Powershell script only converting last sAmAccountname to name -


just wrote quick script below convert samaccountname name. converts last samaccountname in list. why? doing wrong?

$users = get-content .\tempuser.txt $results = @() foreach($user in $users) {   $result = get-aduser -identity $user | select name, samaccountname } $result | out-file .\test12.txt  

change following line adding plus:

$result += get-aduser -identity $user | select name,samaccountname 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -