Get sAmaccountname from displayName with PowerShell

Get samaccountname (logonname) from fullnames:

Get-Content c:\users.txt | get-qaduser | select displayName,sAMAccountName | export-csv c:\output.csv –noType

Users.txt is contains users’ full name.

Leave a Reply