Can Active Directory export lists and flip users' first names with their last names?

Sam Hagos 20 Reputation points
2023-01-18T00:14:58.92+00:00

Hi,

So I've got an Excel file with a bunch of people's names. They're all employees of my company. Their names are organized by "last name, first name." I've been tasked with getting lists of all employees' names in active directory. I know how to generate and export .CSV lists, but those lists will have their names exported as "first name, last name", presumably because that's how they appear in active directory. Is there any way to generate those lists with the last names and then the first name? Preferably with a comma in between those names? Thanks for your time.

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
3,639 questions
No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 18,351 Reputation points Microsoft Employee
    2023-01-18T03:13:55.2066667+00:00

    Hi,

    You can give a try to some PowerShell script like this

    Get-ADUser -Filter * | Select-Object surname,givenname | Export-Csv -Path C:\temp\names.csv -NoTypeInformation
    
    

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful