Powershell/AD | Show Full Names from Usernames

undefined

When exporting from certain applications, the destination format isn’t always acceptable. Although the script below is basic and can be extended on its show the method of showing users full names with their username input. The information is imported via a TXT file into AD, the username is searched in AD and then shows the Displayname property.

 

Get-Content C:\Powershell\users.txt | foreach { 

    (Get-ADUser $_  -Properties DisplayName).DisplayName  

} | Out-File C:\Powershell\UsersOut.txt

 

The input file will hold the usernames in a list and the output file will contain the full names of the users.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.