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
Active DirectoryPowershell
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;  https://gallery.technet.microsoft.com/scriptcenter/Retrieve-a-list-of-Active-90c533a2
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.

Alicia
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros