0
1
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?
0
1
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?
2
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
That worked perfectly (sorry, it took me a while to find the time to try it out). Thanks! – Jonas – 2012-04-05T18:29:14.883
0
This article provides an interesting approach. Maybe it could even be adapted to wmic.
Take the time and research it online. There are plenty of vbscipts that can grab this informantion for you. – onxx – 2012-03-18T17:35:34.807
@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 – 2012-03-18T20:19:34.557
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 – 2012-03-18T21:24:50.373