Getting a user’s displayname without additional AD query

At a customer we have some applications that rely on specific registry keys to be set, to get this info just in time we’re using Appsense Environment Manager with a Process started trigger fot the specific application. The application needs to display the users displayname. Currently we are using a VBS script for it that queries the Active Directory to get the users displayname. Because of latency problems this script sometimes takes way too long so we were searching other ways to do this, should be possible since the start menu is showing the displayname as well.

And we can!

We get this data through the GetUserNameEx function. Below is the ‘Powershell’ code to return this info. Ofcourse this would need some additional work 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *