Je ale nutné si přidat referenci na assembly System.DirectoryServices:
Dim directoryEntry As New DirectoryServices.DirectoryEntry()
directoryEntry.AuthenticationType = DirectoryServices.AuthenticationTypes.Secure
directoryEntry.Path = "WinNT://localhost"
For Each entry As DirectoryServices.DirectoryEntry In directoryEntry.Children
If entry.SchemaClassName = "User" Then
Console.WriteLine(entry.Name)
End If
Next
Console.ReadLine()
|