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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I correlate a user with the workstation s/he uses?

Status
Not open for further replies.
Sep 17, 1999
4
0
0
US
Visit site
Is there a way to determine the name of the workstation a user has logged into through Active Directory?
 
Depends on how much space you want to take up with logging. You can set the event logs of your DC to log these events, but it will log every user that logs in, and which PC. It will fill up the logs pretty quick....
 
I can help you with the opposite. You can choose the Computer name and see who is logged on that system. Here is a VBScript that will accomplish the task. It comes from When you enter the computer name (enterComputerNamehere) keep the Quotes in tact.


strComputer = "enterComputerNameHere"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer
Wscript.Echo "Logged-on user: " & objComputer.UserName
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top