TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dharmarajan
NA
10
3.4k
Active directory code
Dec 21 2009 1:34 AM
Hi,
This the code i wrote to extract all the users details of an organization across domain
System.DirectoryServices.DirectorySearcher mySearcher = new System.DirectoryServices.DirectorySearcher("gc://dc=xxxdomain,dc=net");
mySearcher.Filter = ("(objectCategory=person)");
mySearcher.PageSize = int.MaxValue;
Console.WriteLine("Listing of users in the Active Directory");
Console.WriteLine("========================================");
using (var searchResultCollection = mySearcher.FindAll())
{
foreach (System.DirectoryServices.SearchResult searchResult in searchResultCollection)
{
foreach (string prop in searchResult.Properties["distinguishedname"])
{
Console.WriteLine("distinguishedname : " + prop.Trim());
break;
}
}
}
I got some output that only fetches the data for a particular domain (eg: APJ or NA or EMEA) where the user is accessing the application and not the complete data. Can anyone help me on this what went wrong in the code?
Reply
Answers (
2
)
how to read a text file from an url
Feed back form problem