Determine NT User ID from Machine Name

Is there any way I can determine which network UserID is currently logged on to a particular machine based solely on the machine name?
brian_andrewsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
PBuckConnect With a Mentor Commented:
This might return a listing of what you are looking for:

http://www.mvps.org/vbnet/index.html?code/network/netwkstauserenum.htm

This is the description: "NetWkstaUserEnum lists information about all users currently logged on to the workstation, including service and batch logons, as well as interactive user logons. "

Hope this helps!
0
 
dredgeCommented:
nope.
0
 
dredgeCommented:
the machine name has nothing to do with the current logged on user.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
DiveblueCommented:
Will you be running the process on the machine in or on some other machine??
0
 
brian_andrewsAuthor Commented:
What about the reverse...retrieving a machine name based on a network userid?
0
 
brian_andrewsAuthor Commented:
A remote machine...
0
 
DiveblueCommented:
Check out
if on another machine try looking at this....
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/hh/network/ntlmapi2_6msv.asp

use  NetWkstaGetInfo with WKSTA_INFO_102

You'll need to have privs for this...

Otherwise use GetUserName api.
0
 
DiveblueCommented:
<<What about the reverse...retrieving a machine name based on a network userid? >> That's another question..
0
 
brian_andrewsAuthor Commented:
Thanks, this site provides a good example.
0
 
PBuckCommented:
Super!  VBNet is the site I always try first when I am stuck on something  :-)  Then I give www.planet-source-code.com a try ...

Good Luck!
0
All Courses

From novice to tech pro — start learning today.