Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

How to discover the user logged in a remote workstation

From Tech-Wiki


Monitoring and operational reference for How to discover the user logged in a remote workstation.

ⓘ
Legacy / version-specific guidance
The original article references VBScript legacy. It is retained for historical or version-specific use. Confirm applicability to the target product and version before using the procedure.

Reference

This VBScript will connect to the remote workstation using WMI and query which user is logged on.

strComputer=InputBox("Nome or computer IP address")
'WScript.echo "Hostname: " &strComputer
'WScript.echo "Checking..."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 

Set colComputer = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
 
For Each objComputer in colComputer
    Wscript.Echo "Usuário =" &objComputer.UserName
Next

See also