System.DirectoryServices.DirectoryEntry entryRoot
= new System.DirectoryServices.DirectoryEntr
("WinNT://danny-4649bwcv8", null, null,
AuthenticationTypes.None )
tr
System.DirectoryServices.DirectoryEntries
userEntries = entryRoot.Children
foreac
(System.DirectoryServices.DirectoryEntry user in
userEntries
i
(user.SchemaClassName.Equals("User")
Console.WriteLine(user.Name)
catch
(System.Runtime.InteropServices.COMException e
{
Console.WriteLin
( "Error " + e)
-----Original Message----
In VB, I can write the following code to get the list of
users and groups in the domain ASIA. How do I do the same
in C Set objContainer = GetObject("WinNT://ASIA"
objContainer.Filter = Array("user", "group"
For Each user In objContaine
List1.AddItem user.Nam
NexThanks and Regards
Thoma
Print | Copy URL of this post
.. .
Contact Us | Rules of Conduct
©2004 Microsoft Corporation. All rights reserved. Terms of Use | Privacy Statement