Follow us on Twitter

Have a question on something? Visit the forum for help.

NEW!! LazyNetworkAdmin Forums! Click -> here

 

List User Logged On To A Remote Computer PDF Print E-mail

Hey, who is logged on to the accounting computer on the third floor? Dunno?!!?
Now you don't have to wonder. This script will display the currently logged on user on a remote computer.

Copy and paste the following text into notepad and save it al LoggedOn.vbs

----------COPY EVERYTHING BELOW THIS LINE----------


On error resume next
strComputer = InputBox("Type in the name of the computer you want to query.")
If strComputer > "" Then
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

Else
Wscript.Quit
End If

Wscript.Quit




----------COPY EVERYTHING ABOVE THIS LINE----------



PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN YOUR NOTEPAD!!!


*Make sure you are an administrator to run this.


This information is provided "AS IS" with no warranties expressed or implied.




Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! TwitThis Joomla Free PHP
 
 

Sponsored Links