I have been using the follow script to try and figure out who is logged on to a particular system on my network. All I have to do is change RemoteComputer to whatever remote system I want to find out who is logged into. But for some reason it only shows null for any users other than Administrators. Any suggestions as to what I am doing wrong would be appreciated.
strComputer = "RemoteComputer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem"
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next
strComputer = "RemoteComputer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem"
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next