| | |
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);
Selva ![]() |
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 |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





