HOW TO: Determine logged on User Name from computer name?

K

Kevin McCartney

Hi TWIMC,

Is there a way to determine the user name of the current logged on user of
computer by the computer name. I'm sure there's a API call available, I just
need to know what its called.

TIA
KM
 
K

Kevin McCartney

I know about these two api but these don't help since the name I'm trying to
ascertain belongs to the computer name that I find in the LDB file of the
shared data database. It's the computer names that I find in the LDB file
that I want to loop through and pull back the user name that is currently
logged on to that computer and not the computer or user name of the computer
that I am using which is what the two api that you listed do. I need to find
the user names so that I can send them an email asking them to log out of the
front end application. I know I could use the workgroup access secrutiy and
set each user up, but then theres all the administration of setting access
rights to each object etc etc, which for the little app is a bit over the top.

Anywat, thank for your help ... I'll keep looking

TIA
ciao
KM
 
K

Keith W

Kevin McCartney said:
Hi TWIMC,

Is there a way to determine the user name of the current logged on user of
computer by the computer name. I'm sure there's a API call available, I
just
need to know what its called.

TIA
KM

The Environ method works for me.

Environ("Computername")

Keith.
www.keithwilby.com
 
M

Michel Walsh

Hi,


Then maybe KB article 285822:

=====================


Public Sub ShowUserRosterMultipleUsers()
'KB Q285822


Dim rs As New ADODB.Recordset


Set rs = CurrentProject.Connection.OpenSchema(adSchemaProviderSpecific,
_
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, "",
rs.Fields(2).Name, rs.Fields(3).Name

Do Until rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
rs.MoveNext
Loop
End Sub

========================



Hoping it may help,
Vanderghast, Access MVP
 

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