Results 1 to 3 of 3

Thread: Domain user id

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    india
    Posts
    3

    Domain user id

    i want know the loginname of user currently logged on windows 2000 server.
    or some one please tell me how to get the user name of logged user.
    PKAUSHIK

  2. #2
    Junior Member
    Join Date
    Jul 2003
    Location
    Taiwan
    Posts
    29
    Hope this will help, I use it in the workstation to get user login name
    VB Code:
    1. Option Explicit
    2. Private Declare Function GetUserName Lib "advapi32.dll" _
    3.                         Alias "GetUserNameA" (ByVal lpbuffer As String, _
    4.                         nSize As Long) As Long
    5.  
    6. Public Function GetLoginName() As String
    7.     Dim sBuffer As String
    8.     Dim lSize As Long
    9.     Dim strHostName As String
    10.  
    11.     sBuffer = Space$(255)
    12.     lSize = Len(sBuffer)
    13.    
    14.     Call GetUserName(sBuffer, lSize)
    15.    
    16.     If lSize > 0 Then
    17.         GetLoginName = Left$(sBuffer, lSize)
    18.     Else
    19.         GetLoginName = vbNullString
    20.     End If
    21. End Function

  3. #3
    Addicted Member
    Join Date
    Aug 2003
    Location
    Earth
    Posts
    139
    Hi ,

    one quick way could be executing the command

    net config workstation


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width