Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I log on as jd123, but in the Windows Start Menu, my name is displayed as "John Doe". Obviously, Windows knows how to look up my full name from the LDAP server. Is that information stored in an environment variable somewhere?

share|improve this question
Take the time and research it online. There are plenty of vbscipts that can grab this informantion for you. – onxx Mar 18 '12 at 17:35
@onxx: The reason I asked the question was that I apparently didn't know the right keywords to research it online. Can you at least help me out that far? What is the name displayed in the start menu called? – Jonas Mar 18 '12 at 20:19
Try vbscript active directory username creditinals Im not sure on the specific name myself for that variable as it pulls it from the AD username name fields – onxx Mar 18 '12 at 21:24
up vote 2 down vote accepted

In vbScript you can display the full name like this:

Set sysinfo  = CreateObject("ADSystemInfo")
Set oUser    = GetObject("LDAP://" & sysinfo.UserName & "")
strFullName  = oUser.Fullname

wscript.echo strFullName

There's no environment variable for this, but you can set it from the script by adding the following lines:

Set wshShell   = CreateObject( "WScript.Shell" )
Set wshUserEnv = wshShell.Environment( "USER" )
wshUserEnv("USERFULLNAME") = strFullName
share|improve this answer
That worked perfectly (sorry, it took me a while to find the time to try it out). Thanks! – Jonas Apr 5 '12 at 18:29

This article provides an interesting approach. Maybe it could even be adapted to wmic.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .