You are here: > Administration > Scripts > Adsi > List the User Logged on to a Remote Computer


NOTE: ActiveXperts Network Monitor supports SNMP based checks. It ships with free SNMP GET and SNMP TRAP utilities. It also offers many SNMP scripts (PowerShell and VBScript). Download Now »

List the User Logged on to a Remote Computer in Windows

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.


Returns the user name of the user currently logged on to a remote computer. To use this script, replace atl-ws-01 with the name of the remote computer you want to check. Although this script will run on Windows NT 4.0, Windows 98, and Windows 2000, it will not always return information.


strComputer = "atl-ws-o1"
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