Solved

Determine NT User ID from Machine Name

Posted on 2001-08-14
10
227 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

863 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

19 Experts available now in Live!

Get 1:1 Help Now