databasedemon2002
Programmer
Is there any way of accessing all the user names on a Win 2K machine? I know there is an API to return the user currently logged on.
Any help would be greatly appreciated.
Thanks!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Form_Load()
'Fill the combo with LocalHost and Domains names
Combo1.AddItem Winsock1.LocalHostName
Dim namespace As IADsContainer
Dim domain As IADs
Set namespace = GetObject("WinNT:")
For Each domain In namespace
Combo1.AddItem domain.Name
Next
End Sub
Private Sub Combo1_Click()
'Fill the list whith all users of the selected Domains or LocalHost
On Error Resume Next
List1.Clear
Dim container As IADsContainer
Dim containername As String
containername = Combo1.Text
Set container = GetObject("WinNT://" & containername)
container.Filter = Array("User")
Dim user As IADsUser
For Each user In container
List1.AddItem user.Name
Next
Err = 0
DoEvents
End Sub