Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which set of base classes ot use
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00830225
Message ID:
00830941
Views:
26
Ron,

Here is a VB example that does what you want:
Imports System.DirectoryServices

Module Module1

    Sub Main()

        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

        Console.WriteLine()
        Console.WriteLine("GROUPS:")
        'Clear the previous "User" filter.
        de.Children.SchemaFilter.Clear()
        'Filter for only "Group" entries.
        de.Children.SchemaFilter.Add("group")
        For Each Child In de.Children
            Console.WriteLine(" - " & Child.Name)
        Next Child

        Console.WriteLine()
        Console.WriteLine("SERVICES:")
        'Clear the previous "Group" filter.
        de.Children.SchemaFilter.Clear()
        'Filter for only "Service" entries.
        de.Children.SchemaFilter.Add("service")
        For Each Child In de.Children
            Console.WriteLine(" - " & Child.Name)
        Next Child

        Console.ReadLine()
    End Sub

End Module
>I need to interrogate a domain to get a list of users then a list of groups each user is assigned to. Can someone point me to the proper class to do this.
>
>Or do you still have to go to the windows API in .NET for this as you would in VFP?
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform