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 :)

Read More

Filling Active Directory descriptions

At work we have the procedure that every computeraccount has a specific description containing location, pc model, username. People were filling all this info by hand, not really efficient but it sort of worked the first few weeks…ended up with having 1000+ computer accounts having no description at all.
Now the good part, last year we’ve purchased Lansweeper for some reporting on servers within out domains. Now we didn’t setup the filters so we would only scan servers so we now have all servers/desktops/notebooks into a SQL database for Lansweeper. All info we needed for setting the description is in there we just needed to glue it together so here we go.

Read More