Display Real Name instead of %username%

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.
 
M

Mark V

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.
 
G

Guest

-----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%.
 
W

Wadester

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
 
D

David Trimboli

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top