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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -