Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.