How to convert a username into their "Display Name"

I am trying to write a script to lookup and display a users information (Display Name, Phone Number, etc.) based on their username. I found the code below which will do an LDAP lookup based on the display name, and that works great. To get that to work though, I would need to convert "JJJohnson" into "Johnson, John J" or else be able to do the LDAP lookup based on their logon name rather then their display name. (Either way would be fine with me)

Thanks BlueDevilFan, that is exactly what I am looking for! However, when I converted it to VB.Net, I am getting an "Argument 'Prompt' cannot be converted to type 'String'." Exception on the Msgbox lines. How can I display that info in VB.net?

Value is the default property, but perhaps VB.net doesn't see it that way. Unfortunately I don't have VS on the computer that accesses a domain, so I can't test in .Net. If adding Value doesn't do it, then try setting the value into a variable and then use the variable name in the MsgBox. Something like

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library. Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…

Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…