Link to home
Start Free TrialLog in
Avatar of brian_andrews
brian_andrews

asked on

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?
Avatar of dredge
dredge

nope.
the machine name has nothing to do with the current logged on user.
Will you be running the process on the machine in or on some other machine??
Avatar of brian_andrews

ASKER

What about the reverse...retrieving a machine name based on a network userid?
A remote machine...
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.
<<What about the reverse...retrieving a machine name based on a network userid? >> That's another question..
ASKER CERTIFIED SOLUTION
Avatar of PBuck
PBuck

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, this site provides a good example.
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!