Obtaining complete User List

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi all,

My question is: How do you obtain a complete list of all the users
that are registered on the local machine? I've been trying for hours
now and can't find anything that will help on the groups.

Anyone have any idea how to do this in VB.NET?

thanks

Dave
 
Hi after a bit of searching I found this sample on the newsgroup which does
what you want:

Add reference to System.DirtectoryServices

Imports System.DirectoryServices

Dim de As DirectoryEntry
Dim Child As DirectoryEntry

de = New DirectoryEntry("WinNT://" & Environment.MachineName & ",computer")
'Filter for only "User" entries.
de.Children.SchemaFilter.Add("user")

Console.WriteLine("USERS:")
For Each Child In de.Children
Console.WriteLine(" - " & Child.Name)
Next Child


Hope this helps

Greetz, Peter
 
Back
Top