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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -