Display Real Name instead of %username%

  • Thread starter Thread starter Erik
  • Start date Start date
E

Erik

How can I display the person's real name in a logon
script as compared to their username? I can't seem to
find the right variable in AD.

Thanks.
 
In said:
How can I display the person's real name in a logon
script as compared to their username? I can't seem to
find the right variable in AD.

With what tools?

net user %username% | find.exe "Full Name" might get you started.
 
-----Original Message-----


With what tools?

net user %username% | find.exe "Full Name" might get you started.
.

Sorry about that, in a login script. Something like:

echo Hello %realname%.
 
In
Sorry about that, in a login script. Something like:

echo Hello %realname%.

Working off of Mark V's idea, you could use:

for /f "tokens=3,4" %%i in ('net user %username% /domain ^| find /i "full
name"') do set name=%%i %%j
echo hi, %name%

ws
 
Wadester said:
In

Working off of Mark V's idea, you could use:

for /f "tokens=3,4" %%i in ('net user %username% /domain ^| find /i "full
name"') do set name=%%i %%j
echo hi, %name%

If the user has more than a first name and a last name (for instance, a
middle initial) listed, this won't get it all. Try this:


for /f "tokens=2*" %%i in ('net user %username% /domain ^| find "Full
Name"') do set name=%%j

echo Hello, %name%.


David
Stardate 3851.3
 
Back
Top