VB projects - View NT Groups
Description: shows list of groups/users on specified computer (for computer from other domain enter "domain_name/computer_name")
Minimum requirements: VB5, Windows NT/2000, ADSI
Download: source code
Screenshot:

Project: Standard EXE
References: Active DS Type Library
Controls: opt (OptionButton), opt (OptionButton), cmdGet (CommandButton), lst (ListBox)
Code:
Option Explicit
Private Sub cmdGet_Click()
Dim c As IADsComputer
Dim v As IADs
Dim sComputer As String
Dim sFind As String
On Error Resume Next
lst.Clear
If opt(0).Value Then sFind = "Group" Else sFind = "User"
sComputer = InputBox("Enter the computer name", "Computer name")
If Trim(sComputer) <> "" Then
Set c = GetObject("WinNT://" & sComputer & ",computer")
If Err <> 0 Then
MsgBox "Computer not found", vbCritical, "Critical Error"
Else
For Each v In c
If v.Class = sFind Then lst.AddItem v.Name
Next
End If
Else
MsgBox "Computer not found", vbCritical, "Critical Error"
End If
End Sub
|