troubleshooting Question

How to Generate List of Network Logins from List of User Display Names

Avatar of Spike99
Spike99Flag for United States of America asked on
PowershellActive Directory
3 Comments1 Solution108 ViewsLast Modified:
I get frequent requests to retrieve the login ID for a list of users which comes in a list like this:

Smith, John
Doe, Jane
Parker, Peter
Wilson, Wade
Clooney, George
Public, John Q.

The names in the lists I get are identical to their AD display names.  Display Names in our AD are always "Last Name, First Name." Sometimes, they do include the Middle Initial ("Last Name, First Name MI").

I tried using the function I found on this page;
But, apparently the running of unsigned scripts is blocked on my network:  I am unable to set Execution Policy to unrestricted so that I can run it.
I tried creating a script myself, but I'm having no luck.

I would like to import the list of users from a TXT, CSV or XLSX file, run the operation to get the samAccountName & then output the results to TXT or CSV.

I am running this on a Windows 7 Enterprise computer with ActiveDirectory tools loaded and PowerShell v. 4.

Thanks in advance for any advice you can give.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 3 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 3 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004