I get frequent requests to retrieve the login ID for a list of users which comes in a list like this:
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.