Results 1 to 6 of 6

Thread: List all users currently logged on in the domain

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    1

    List all users currently logged on in the domain

    Is it possible to list all users currently logged on in the domain (active directory) using vb6?

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: List all users currently logged on in the domain

    Rather than ask a few questions, I'll just point you towards here:

    http://msdn.microsoft.com/library/de...ting_users.asp

  3. #3
    Hyperactive Member dRAMmer's Avatar
    Join Date
    Oct 2001
    Location
    strangelans
    Posts
    463

    Re: List all users currently logged on in the domain

    I was already able to display all the users in a domain. But my problem was that I got all the info (eg. fullname, firstname, address) except for the username. How can I get a user's username in a domain? (in vb6 pls)

    Thanks in advance!
    live, code and die...

  4. #4
    New Member
    Join Date
    Sep 2006
    Posts
    14

    Re: List all users currently logged on in the domain

    Please can you send me the code to get all user names from active directory.

    here is your code to get username:

    Public Function rgbGetUserName() As String
    'return the name of the user
    Dim tmp As String
    tmp = Space$(MAX_USERNAME)
    If GetUserName(tmp, Len(tmp)) Then
    rgbGetUserName = TrimNull(tmp)
    End If
    End Function

    Private Function TrimNull(item As String)
    Dim pos As Integer
    pos = InStr(item, Chr$(0))
    If pos Then
    TrimNull = Left$(item, pos - 1)
    Else: TrimNull = item
    End If
    End Function


    In declaration part u have to use this.
    Private Declare Function GetUserName Lib "advapi32" _
    Alias "GetUserNameA" _
    (ByVal lpBuffer As String, _
    nSize As Long) As Long

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List all users currently logged on in the domain

    Did you not see the link in Post #2?

  6. #6
    Hyperactive Member dRAMmer's Avatar
    Join Date
    Oct 2001
    Location
    strangelans
    Posts
    463

    Re: List all users currently logged on in the domain

    Something came back from the grave.
    live, code and die...

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