Windows Thread, Environment Variable for a users full name. in Technical; I was wondering if there was a variable for a users full name?
I want to add a users full ...
13th May 2010, 06:39 PM #1
Environment Variable for a users full name.
I was wondering if there was a variable for a users full name?
I want to add a users full name into the reg key for the office user at login. I've been playing and I've used GP Preferences to replace the current value of
CU\Software\Microsoft\Office\Common\UserInfo\UserN ame with %USERNAME%
This works and is OK, but would be much better if I could pick a users "Name" (e.g John S. Smith)
IDG Tech News
13th May 2010, 11:02 PM #2
No, there isn't.
Type set from a cmd prompt and it'll show you all the current environment variables.
Your only option, really, is going to be to use a vbscript that queries active directory for the value
14th May 2010, 11:09 AM #3
Rubbish... better head over to the scripting forum and see if someone can tell me how to do that then.
My VBS skills are best described as "poor"
16th May 2010, 12:42 PM #4
It is possible to get this info from CMD using the following;
above code from this Experts Exchange post
for /f "tokens=2*" %%a in ('net user "%Username%" /domain ^| find /i "Full Name"') do set DisplayName=%%b
echo Your display name is "%DisplayName%"
Alternatively, using VB, the following code (although not tested as I wrote at home), should get the full name (aka DisplayName) into the strFullName variable for you. You then have the fun job of writing it to the registry using WMI if you insist on using VB.
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strFullName = objUser.Get("displayName")
By cookie_monster in forum Coding
Last Post: 22nd April 2013, 09:04 AM
By SimpleSi in forum *nix
Last Post: 10th March 2009, 07:15 PM
By damienharrison in forum Virtual Learning Platforms
Last Post: 26th September 2007, 11:15 AM
By PiqueABoo in forum Scripts
Last Post: 14th December 2006, 12:09 AM
By drjturner in forum Windows
Last Post: 23rd November 2006, 10:07 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)