Q: Can I get the network login name from the computer name?

M

MarkD

Okay, so here's the deal.

I can find the users logged onto a database by using the
code here:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnimo01/html/o2k0135.asp

Unfortunately, this is an unsecured database so all the
login names show up as "Admin". But I can get the computer
name. Is there a way to find out the network id from the
computer name? Or, is there another way to find the
network id than by using this code?

Thanks!
-Mark
 
M

MarkD

Hi Cheryl,

Thanks for the links. I actually found those links
earlier, but it doesn't help with my problem (unless I
missed something).

What I have is code that finds all the computer names
logged onto a database. I need to find the network ids.

The links below will tell me what *I* am logged in as and
what *my* computer name is, but it doesn't tell me what
the network id's are of the *other people* online.

What I need is a function that accepts the computer name
as the parameter and returns the network id. Any ideas?

-Mark
 
C

Chris

Hi,

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

I'm not sure, but you should be able to pass a remote
computer name to find the user logged in.

What Cheryl was talking about is to have the application
record the username on login. Then, you'll know who it
was.

Chris
 
G

Guest

Hey Chris,

Thanks for the link. Unfortunately, that doesn't look like
it'll work either. I tried plugging in another
computername and got and error. My computername, however,
worked. So I'm guessing it's a security issue at this
point.

As for recording the user/computername for a given user,
that's pretty simple. We have the environment set at work
so we can get it from the Environ$() function. But it
still doesn't help me because I have to get that string
from the remote computer and I don't know how to do that.
Having each instance of the database populate some the
network ID on some hidden table would just be too much
work.

-Mark
 
C

Chris

There is a way to do this, as I have done it before. I
believe it has to be a 2000/NT/XP workstation. I will
look for the answer. It exists.

Chris
 
G

Guest

Well, I found this:

NetWkstaUserGetInfo(): to get the current user on a station
NetWkstaGetInfo(): to get other information about a
workstation.


But no info on using it yet.
 
M

MarkD

It does look like you can get the information from the
code you supplied, but you need to have administrator
rights. Makes sense to me that userid information would be
blocked. I created a table that has the users for a given
computer. That seems to work unless it's some other user
on that computer, but at least we know which computer is
the culprit.

I appreciate all the help, though!

-Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top