Find log-on User Name 
Author Message
 Find log-on User Name

Is there a WIN API function will take PC name as input parameter and
return a log-on user name ?


Sat, 09 Dec 2000 03:00:00 GMT  
 Find log-on User Name

This should do the work...

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
              (ByVal lpBuffer As String, nSize As Long) As Long
'To retrieve a "clean" version of the name, use this function:

Public Function DomainUserName() As String
Dim strBuffer As String * 255
Dim lngBufferLength As Long
Dim lngRet As Long
Dim strTemp As String
lngBufferLength = 255
lngRet = GetUserName(strBuffer, lngBufferLength)
strTemp = UCase(Trim$(strBuffer))
NTDomainUserName = strTemp 'Left$(strTemp, Len(strTemp) - 1)
End Function


>Is there a WIN API function will take PC name as input parameter and
>return a log-on user name ?


Sun, 10 Dec 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Finding the workstation name of a currently logged on user

2. listing NT logon names of logged on users to database

3. Getting the user's logon name and computer name

4. Current Domain User Name of logged in user?

5. Logon users name

6. Get current user logon name

7. Capturing the log in user name

8. NT domain logon id or user name

9. Capture user name from MS Access logon screen

10. Lock CD-drive and find out logon-name

11. log computer and user names

12. How to get full name of logon user?


Powered by phpBB® Forum Software