| | |
Get Users from Windows Active Directory
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
•
•
Hi,
Can anyone let me know how to list all the users from a windows active directory using C#.
thanks.
santosh.
First include System.DirectoryServices.dll.
Then try this code
C# Syntax (Toggle Plain Text)
DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.MachineName); string userNames="Users : "; foreach (DirectoryEntry child in directoryEntry.Children) { if (child.SchemaClassName == "User") { userNames += child.Name + Environment.NewLine ; } } MessageBox.Show(userNames);
KSG
![]() |
Similar Threads
- How to Enable/Disable Users thro' C++ or any code (C++)
- Adding user and mailbox in Active Directory (Python)
- server setup (Networking Hardware Configuration)
- Setup Outlook Signature for Domain Users (Windows NT / 2000 / XP)
- Active Directory 2003 Script (Python)
- Windows users(group) in network(share file) (Networking Hardware Configuration)
- Windows 2003 logon (Windows NT / 2000 / XP)
- Windows 2003 security (Windows NT / 2000 / XP)
- os 10.x and active directory q ? (OS X)
- Security(sharing) not working for domain users, names are not resolving..... (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: Need Your help please
- Next Thread: C# connect to PHP
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop picturebox pixelinversion platform post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





