Here is all tools what you need

VB Code:
  1. Private Sub Command1_Click()
  2.    
  3.     Dim Temp As String
  4.     subGetComputerUsersInfo
  5.     Temp = ComputerUsers.username
  6.     'ect...
  7.    
  8. End Sub
  9.  
  10. ' Module Code
  11. Option Explicit
  12.  
  13. 'by oh1mie
  14.  
  15. Private Const ERROR_SUCCESS As Long = 0&
  16. Private Const MAX_COMPUTERNAME As Long = 15
  17. Private Const MAX_USERNAME As Long = 256
  18. Private Const FILTER_NORMAL_ACCOUNT  As Long = &H2
  19.  
  20. Private Type USER_INFO_10
  21.    usr10_name          As Long
  22.    usr10_comment       As Long
  23.    usr10_usr_comment   As Long
  24.    usr10_full_name     As Long
  25. End Type
  26.  
  27. Private Type USER_INFO
  28.    name          As String
  29.    fullname      As String
  30.    comment       As String
  31.    usrcomment    As String
  32. End Type
  33.  
  34. Private Type ComputerUsers
  35.    username                    As String
  36.    Computername                As String
  37.    usrname                     As String
  38.    usrfullname                 As String
  39.    usrcomment                  As String
  40.    usrusrcomment               As String
  41.    USER_INFO()                 As USER_INFO
  42. End Type
  43.  
  44. Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
  45.         (ByVal lpBuffer As String, nSize As Long) As Long
  46.  
  47. Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _
  48.         (ByVal lpBuffer As String, nSize As Long) As Long
  49.  
  50. Private Declare Function NetUserGetInfo Lib "Netapi32" _
  51.         (lpServer As Byte, username As Byte, _
  52.         ByVal level As Long, lpBuffer As Long) As Long
  53.  
  54. Private Declare Sub CopyMemory Lib "kernel32" _
  55.         Alias "RtlMoveMemory" (Destination As Any, Source As Any, _
  56.         ByVal Length As Long)
  57.  
  58. Private Declare Function NetApiBufferFree Lib "Netapi32" _
  59.         (ByVal Buffer As Long) As Long
  60.  
  61. Private Declare Function lstrlenW Lib "kernel32" _
  62.        (ByVal lpString As Long) As Long
  63.  
  64. Private Declare Function NetUserEnum Lib "Netapi32" _
  65.        (servername As Byte, ByVal level As Long, _
  66.        ByVal filter As Long, buff As Long, _
  67.        ByVal buffsize As Long, entriesread As Long, _
  68.        totalentries As Long, resumehandle As Long) As Long
  69.  
  70. Public ComputerUsers  As ComputerUsers
  71. Public Sub subGetComputerUsersInfo()
  72.  
  73.    On Local Error Resume Next
  74.  
  75.    Dim tmp  As String
  76.    Dim LCID As Long
  77.    
  78.    With ComputerUsers
  79.    .username = fcnrgbGetUserName()
  80.    .Computername = fcnrgbGetComputerName()
  81.    
  82.    Dim usr As USER_INFO
  83.    Dim bUsername() As Byte
  84.    Dim bServername() As Byte
  85.    If Len(.username) And Len(.Computername) Then
  86.       bUsername = .username & Chr(0)
  87.       tmp = .Computername
  88.       If Len(tmp) Then
  89.          If InStr(tmp, "\\") Then
  90.                bServername = tmp & Chr(0)
  91.          Else: bServername = "\\" & tmp & Chr(0)
  92.          End If
  93.       End If
  94.       usr = fcnGetUserNetworkInfo(bServername(), bUsername())
  95.       .usrname = usr.name
  96.       .usrfullname = usr.fullname
  97.       .usrcomment = usr.comment
  98.       .usrusrcomment = usr.usrcomment
  99.    End If
  100.  
  101.    Call fcnGetUserEnumInfo(bServername())
  102.  
  103.    End With
  104.    
  105. End Sub
  106. Private Function fcnrgbGetUserName() As String
  107.  
  108.    On Local Error Resume Next
  109.  
  110.   'return the name of the user
  111.    Dim tmp As String
  112.    
  113.    tmp = Space(MAX_USERNAME)
  114.    
  115.    If GetUserName(tmp, Len(tmp)) Then
  116.       fcnrgbGetUserName = fcnTrimNull(tmp)
  117.    End If
  118.  
  119. End Function
  120. Private Function fcnGetUserNetworkInfo(bServername() As Byte, _
  121.                                     bUsername() As Byte) As USER_INFO
  122.    On Local Error Resume Next
  123.    
  124.    Dim usrapi As USER_INFO_10
  125.    Dim buff As Long
  126.    
  127.    If NetUserGetInfo(bServername(0), bUsername(0), 10, buff) = ERROR_SUCCESS Then
  128.      
  129.      'copy the data from buff into the
  130.      'API user_10 structure
  131.       CopyMemory usrapi, ByVal buff, Len(usrapi)
  132.      
  133.      'extract each member and return
  134.      'as members of the UDT
  135.       fcnGetUserNetworkInfo.name = fcnGetPointerToByteStringW(usrapi.usr10_name)
  136.       fcnGetUserNetworkInfo.fullname = fcnGetPointerToByteStringW(usrapi.usr10_full_name)
  137.       fcnGetUserNetworkInfo.comment = fcnGetPointerToByteStringW(usrapi.usr10_comment)
  138.       fcnGetUserNetworkInfo.usrcomment = fcnGetPointerToByteStringW(usrapi.usr10_usr_comment)
  139.    
  140.       NetApiBufferFree buff
  141.    
  142.    End If
  143.    
  144. End Function
  145. Private Function fcnGetPointerToByteStringW(lpString As Long) As String
  146.  
  147.    On Local Error Resume Next
  148.  
  149.    Dim buff() As Byte
  150.    Dim nSize As Long
  151.    
  152.    If lpString Then
  153.    
  154.      'its Unicode, so mult. by 2
  155.       nSize = lstrlenW(lpString) * 2
  156.      
  157.       If nSize Then
  158.          ReDim buff(0 To (nSize - 1)) As Byte
  159.          CopyMemory buff(0), ByVal lpString, nSize
  160.          fcnGetPointerToByteStringW = buff
  161.      End If
  162.      
  163.    End If
  164.    
  165. End Function
  166. Private Function fcnGetUserEnumInfo(bServername() As Byte)
  167.    
  168.    On Local Error Resume Next
  169.    
  170.    Dim users()      As Long
  171.    Dim buff         As Long
  172.    Dim buffsize     As Long
  173.    Dim entriesread  As Long
  174.    Dim totalentries As Long
  175.    Dim cnt          As Integer
  176.    Dim StrX(10)     As String
  177.    Dim tmp          As String
  178.    Dim usr          As USER_INFO
  179.    Dim bUsername()  As Byte
  180.    
  181.    buffsize = 255
  182.    tmp = ComputerUsers.Computername
  183.    If Len(tmp) Then
  184.       If InStr(tmp, "\\") Then
  185.            bServername = tmp & Chr(0)
  186.       Else: bServername = "\\" & tmp & Chr(0)
  187.       End If
  188.    End If
  189.    
  190.    If NetUserEnum(bServername(0), 0, _
  191.                    FILTER_NORMAL_ACCOUNT, _
  192.                    buff, buffsize, _
  193.                    entriesread, _
  194.                    totalentries, 0&) = ERROR_SUCCESS Then
  195.    
  196.       ReDim users(0 To entriesread - 1) As Long
  197.       CopyMemory users(0), ByVal buff, entriesread * 4
  198.      
  199.       For cnt = 0 To entriesread - 1
  200.          StrX(cnt) = fcnGetPointerToByteStringW(users(cnt))
  201.          bUsername = StrX(cnt) & Chr(0)
  202.          usr = fcnGetUserNetworkInfo(bServername(), bUsername())
  203.          ReDim Preserve ComputerUsers.USER_INFO(cnt)
  204.          ComputerUsers.USER_INFO(cnt).comment = usr.comment
  205.          ComputerUsers.USER_INFO(cnt).fullname = usr.fullname
  206.          ComputerUsers.USER_INFO(cnt).name = usr.name
  207.          ComputerUsers.USER_INFO(cnt).usrcomment = usr.usrcomment
  208.       Next cnt
  209.      
  210.       NetApiBufferFree buff
  211.    
  212.    End If
  213.  
  214. End Function
  215. Private Function fcnrgbGetComputerName() As String
  216.    
  217.    On Local Error Resume Next
  218.  
  219.   'return the name of the computer
  220.    Dim tmp As String
  221.    
  222.    tmp = Space(MAX_COMPUTERNAME + 1)
  223.    If GetComputerName(tmp, Len(tmp)) <> 0 Then
  224.       fcnrgbGetComputerName = fcnTrimNull(tmp)
  225.    End If
  226.    
  227. End Function
  228. Private Function fcnTrimNull(Item As String)
  229.  
  230.    On Local Error Resume Next
  231.  
  232.    Dim pos As Integer
  233.    
  234.    pos = InStr(Item, Chr(0))
  235.    
  236.    If pos Then
  237.          fcnTrimNull = Left(Item, pos - 1)
  238.    Else: fcnTrimNull = Item
  239.    End If
  240.    
  241. End Function