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!

Can I find the username logged into a particular host?

Status
Not open for further replies.

ATVrider

IS-IT--Management
Jun 27, 2007
9
0
0
US
I've got a Windows 2000 server with AD and other 2003 servers on my server network. I don't have, nor can I afford SMS. I need to know who is logged into a PC on my network. I know the host name. Is there a cheap/quick/easy way to do such a thing? Thanks for the help
 
This is a Microsoft Powershell script that will do that for you.

$CS = Gwmi Win32_ComputerSystem -Comp $args
"Machine Name: " + $CS.Name
"Logged On User: " + $CS.UserName


It take a command line argument, so at the PS command line it would be:

PS >.\script.ps1 SystemName

Powershell is available here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top