Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to input a username and output the workstation?

Status
Not open for further replies.

ampm24

Technical User
Dec 1, 2001
16
US
I have a script that I use that will output who is logged in on a workstation, but sometimes I need the opposite. Like when someone calls me with a PC problem that I need to remote in to fix. They don't know their computer name, and it's a pain to walk some of my users through the process of finding it. Is there a way to have a script ask for the username, and output the workstation or workstations there logged into. Usually only myself and one other person log into multiple machines. It would be a big help, but I couldn't figure out how to do it.

 
you should find a number of previous posts on this subject, try the search option for the forum
 
we did it in a number of ways
1. a 'WhoAmI' script which has a shortcut to it in Start menu, when the user clicks on it it displays the username/machinename,ip info etc in a msgbox
2. logonscript creates central audit files, simple vbscript for helpdesk which finds the text file per user, reads the computername=cccc in that audit file for the users last logon
3. one could use a user logonscript to update the AD user or computer object extendedattr4 with the user or machine details, then write a script to read those values for HD to user?
4. some posts have been about writing trawling scripts to remote to all WMI hives on all machines until you find a match

there are pros and cons to all i guess
 
I guess there are some choices. I have searched but didn't find exactly what I was looking for. Maybe I'll dive into that a little more. I use Ezaudit to audit all the PCs, but that still requires me to to into the software and look up the user. I have the persons name in my AD computer tree, but there not always accurate cause people like to move around some times and I don't always remember to update those. I guess option 4 there sounds like what i'm looking for the most, although 3 looks like it would save me some work in the future. I'll search around again. thanks.
 
option 4, tell a central helpdesk with 8000 users over x wan connections to WMI connect to loads of remote machines
 
the IADsComputer class has a PrimaryUser property, you can write to it
 
Ya, I'm only looking at 125 users on a 1gig/100meg network with newer machines. It is a lot of load though. I think I might add some code to there login script to update the computer description in AD. does that sound like a good idea?
 
unless AD already stores the info somewhere i would go the AD update route, seems to be a good use of an LDAP server

i would also back it up with good logonscript logging
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top