Solved

Determine NT User ID from Machine Name

Posted on 2001-08-14
10
224 Views
Last Modified: 2010-05-02
Is there any way I can determine which network UserID is currently logged on to a particular machine based solely on the machine name?
0
Comment
Question by:brian_andrews
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 5

Expert Comment

by:dredge
ID: 6385441
nope.
0
 
LVL 5

Expert Comment

by:dredge
ID: 6385444
the machine name has nothing to do with the current logged on user.
0
 
LVL 3

Expert Comment

by:Diveblue
ID: 6385453
Will you be running the process on the machine in or on some other machine??
0
 

Author Comment

by:brian_andrews
ID: 6385455
What about the reverse...retrieving a machine name based on a network userid?
0
 

Author Comment

by:brian_andrews
ID: 6385457
A remote machine...
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Expert Comment

by:Diveblue
ID: 6385470
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
 
LVL 3

Expert Comment

by:Diveblue
ID: 6385510
<<What about the reverse...retrieving a machine name based on a network userid? >> That's another question..
0
 
LVL 4

Accepted Solution

by:
PBuck earned 100 total points
ID: 6385515
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
 

Author Comment

by:brian_andrews
ID: 6385592
Thanks, this site provides a good example.
0
 
LVL 4

Expert Comment

by:PBuck
ID: 6385674
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now