Variable for NAME in start menu?

G

Guest

I have a utility called bginfo that will display many windows variables on
the desktop. It will display customized variables from a file, reg. setting
etc.

It will automatically display the username, what I am looking for is the
display name. Here is my situation and why I believe it to be the display
name.

I am the network admin at a High school. I have created accounts for
students using their student ID as their username. I have placed the
student's real name in the -display portion of the dsadd user. The usernames
of students are their ID numbers but when they click on the start button
their names show up not the ID number. I would like to know what variable
this name is, or how to find it, so I can have it displayed on the desktop
with the bginfo program. Any information would be greatly appreciated.

Thank-you in advance.
Scott
 
G

Guest

"Jose Gallardo" wrote:
It is not the %username% variable. When I deop to a dos prompt and type
echo %username% I get the student ID number not the student name. When I
click on start I get the student NAME not the ID number. These are not the
same. I am looking for the variable displayed in the start menu. It is what
ever is stored in the "display name" field of the active directory account.
I tested this by changing my account's display name to be "This is a Test".
I logged off, and back on with my username of scroskey. When I click on
start, the name at the top is "This is a Test", when I go to a dos prompt and
type echo %username% it comes up "scroskey". The BGInfo program already
displays the %username% variable and this does not help me since teachers do
not know what students ID numbers are. If I could display the full name of
the student, then teachers will know at a glance if the student has logged in
with the correct credentials.
 
J

Jose Gallardo

When I type "echo %username%" I see my username...

--
Microsoft MVP Windows - Shell/User


scroskey said:
:
It is not the %username% variable. When I deop to a dos prompt and type
echo %username% I get the student ID number not the student name. When I
click on start I get the student NAME not the ID number. These are not the
same. I am looking for the variable displayed in the start menu. It is what
ever is stored in the "display name" field of the active directory account.
I tested this by changing my account's display name to be "This is a Test".
I logged off, and back on with my username of scroskey. When I click on
start, the name at the top is "This is a Test", when I go to a dos prompt and
type echo %username% it comes up "scroskey". The BGInfo program already
displays the %username% variable and this does not help me since teachers do
not know what students ID numbers are. If I could display the full name of
the student, then teachers will know at a glance if the student has logged in
with the correct credentials.
 
J

Jose Gallardo

Take a look:

http://www.winguides.com/registry/display.php/370/

--
Microsoft MVP Windows - Shell/User


When I type "echo %username%" I see my username...

--
Microsoft MVP Windows - Shell/User


scroskey said:
:
It is not the %username% variable. When I deop to a dos prompt and type
echo %username% I get the student ID number not the student name. When I
click on start I get the student NAME not the ID number. These are not the
same. I am looking for the variable displayed in the start menu. It is what
ever is stored in the "display name" field of the active directory account.
I tested this by changing my account's display name to be "This is a Test".
I logged off, and back on with my username of scroskey. When I click on
start, the name at the top is "This is a Test", when I go to a dos prompt and
type echo %username% it comes up "scroskey". The BGInfo program already
displays the %username% variable and this does not help me since teachers do
not know what students ID numbers are. If I could display the full name of
the student, then teachers will know at a glance if the student has logged in
with the correct credentials.
 
G

Guest

I agree 100% that %username% will display the username of the person logged
into the machine. The problem is that I do not want the username! Here is
as specific as I can get. Student will log on with the following:

username: 44585
Password: ***
Domain: MCS

If I echo %username% I will get 44585 (which IS the username!)
when I click on the start button, the name at the top says John Smith.

Therefore the name at the top of the startmenu could not possible be
%username% or it would say 44585 in stead of John Smith!

Now when I go to the server and look at the activedirectory account for user
44585 I see on the general tab John listed for the first name Smith listed
for the last name and John Smith listed for the display name. When I look at
the account tab I see 44585 listed for the username/login name. I do not
want the username. I want the display name.

Here is a screen capture of the start menu and an open dos prompt withthe
echo %username% You can see they are different!

http://www.marionharding.org/screenshot.jpg

Please notice that the start menu says "This is a test" whlie the dos window
says %username% is admin and you can see the BGInfo app running that has
placed the username (admin), IP addresses and service pack information on the
desktop. Since a student's username is their ID number the only thing that
is going to be listed here is numbers. I would like to have the name that is
appearing in the start menu listed! THEY ARE NOT THE SAME!
 
G

Guest

For anyone interested in this, I did find a solution to the problem. The DS
query command combined with the dsget command can return this result. If
written to a file, it can then be read and used in the program. Here is the
command you would need to use.

dsquery user -name %username% | dsget user -display > %temp%\file.txt

I chose to use the %temp% variable so it would write the file in each users
temp directory where I know they have access to write to the hard drive. You
will need to have the dsquery, and dsget commands loaded on each computer in
the windows\system32 directory (or anywhere in the search path)These can be
found on Microsofts web site with a search.

Hope someone else can benefit from this.
Scott
 

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