Solved

Determine NT User ID from Machine Name

Posted on 2001-08-14
10
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

739 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