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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What userid is logged on to a remote Win2K PC?

Status
Not open for further replies.

gharr99

MIS
May 14, 2002
4
US
If I know the name of a remote Windows 2000 PC and the IP address, is there a way I can see what userid is logged on to that PC? Is there any third party software that I can use to help me?
 
Do you have admin rights on the machine? If you can access the registry remotely, check the value of this key:

HKLM\System\CurrentControlSet\Services\NM\Parameters\UserName

The value will be the user that is currently logged in. I'm sure you can write a nifty little script to do it for you so you can check multiple machines.

Good Luck!

Tim
Certified AND Qualified
[thumbsup2]
 
Thank you for the reply.

I do have administrative rights. How do I access the registry on a remote PC?
 
You can use Regedt32, click on Registry and then Select Computer and type in the computer name.

Good Luck!!!

Tim
Certified AND Qualified
[thumbsup2]
 
Thank you again for your reply.

I tried using the Regsvr32 and it worked perfectly. Thanks again for your help.
 
What I use is a free utility from sysinternals, psloggedon, it runs from the command line and will return the information quicker thatn going to the registry.
 
Tim:

Could you tell me where within the registry you go to see who is logged onto that PC at that moment?


Thanks


Paul
 
Paul,

HKLM\System\CurrentControlSet\Services\NM\Parameters\UserName

is the location of the registry key that will tell you who is currently logged on to a machine.

Here's a little VBscript that you can use that will work as well.

Code:
On Error Resume Next
strComputer = InputBox("Enter Computer Name:","Logged-in User Check")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems

Result = MsgBox("UserName: " & objItem.UserName, 65, "Logged-in User Check")

Next


Good Luck!

Tim
Certified AND Qualified
[thumbsup2]
 
Hey Tim.

Thanks for the info, however I was unable to pull it up on any of the W2K Systems I tried to do so from the server... In both regedt32 and regedit once I drilled down to Services there was no entry for NM. I tried Netman and Netlogon but could not find anything useful there.
Should there be an NM entry under HKLM\System\CurrentControlSet\Services?

Thanks

Paul
 
Paul,

Sorry about that... Try this one:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName

Good Luck!!!

Tim
Certified AND Qualified
[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top