•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 423,566 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,641 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 2341 | Replies: 2
![]() |
•
•
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 454
Reputation:
Rep Power: 1
Solved Threads: 78
•
•
•
•
Hi,
Can anyone let me know how to list all the users from a windows active directory using C#.
thanks.
santosh.
Hi,
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
antivirus apple browser computer crack dell desktop development gartner google hoax install internet leopard linux mac media merger microsoft mobile mozilla news novell office open operating operating system os photo pirate registry research root safari security server software source sp1 system ubuntu unix upgrade vista web windows windows update windows vista xp yahoo
- 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 / 2003)
- Active Directory 2003 Script (Python)
- Windows users(group) in network(share file) (Networking Hardware Configuration)
- Windows 2003 logon (Windows NT / 2000 / XP / 2003)
- Windows 2003 security (Windows NT / 2000 / XP / 2003)
- os 10.x and active directory q ? (OS X)
- Security(sharing) not working for domain users, names are not resolving..... (Windows NT / 2000 / XP / 2003)
Other Threads in the C# Forum
- Previous Thread: Need Your help please
- Next Thread: C# connect to PHP


Linear Mode