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

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

Post by S2V2aW4gTW » Wed, 16 Nov 2005 21:31:08


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
 
 
 

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

Post by Michel Wal » Wed, 16 Nov 2005 22:42:59

Hi,

For the user name: http://www.yqcomputer.com/


For one of the computer name: http://www.yqcomputer.com/



Hoping it may help,
Vanderghast, Access MVP

"Kevin McCartney" < XXXX@XXXXX.COM > wrote in

 
 
 

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

Post by S2V2aW4gTW » Wed, 16 Nov 2005 23:31:21

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
 
 
 

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

Post by Keith » Thu, 17 Nov 2005 00:51:40

"Kevin McCartney" < XXXX@XXXXX.COM > wrote in


The Environ method works for me.

Environ("Computername")

Keith.
www.keithwilby.com
 
 
 

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

Post by Michel Wal » Thu, 17 Nov 2005 01:26:35

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


"Kevin McCartney" < XXXX@XXXXX.COM > wrote in