Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 958141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:48:57+00:00 2026-05-16T00:48:57+00:00

I did some programming for reading the data from Active Directory such as user

  • 0

I did some programming for reading the data from Active Directory such as user account or Orgnization info and so on. The code below is like something what I did.

DirectoryEntry entry = new DirectoryEntry(
    "LDAP://CN=Users,DC=domain,DC=com",
    null,
    null,
    AuthenticationTypes.Secure
    );

DirectorySearcher search = new DirectorySearcher(entry);

using (SearchResultCollection src = search.FindAll())
{
    foreach (SearchResult result in src)
    {
        Console.WriteLine(result.Properties["name"][0] + " : " + 
                          result.Properties["department"][0]);
    }
}

The problem is how can I know what properties that target objects have then I can use them to filter the data before get it all.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:48:58+00:00Added an answer on May 16, 2026 at 12:48 am

    If you have a DirectoryEntry, you can inspect its .SchemaEntry:

    DirectoryEntry entry = new DirectoryEntry("LDAP://......");
    
    DirectoryEntry schema = entry.SchemaEntry;
    

    This should – if you have the necessary permissions – give you access to the properties defined in the schema – things like MandatoryProperties or OptionalProperties:

    foreach (var prop in schema.Properties.PropertyNames)
    {
       string propName = prop.ToString();
       var propValue = schema.Properties[propName].Value;
    }
    

    Does that help you get started??

    You might also want to have a look at BeaverTail – my C# open-source LDAP browser.

    alt text
    (source: mvps.org)

    It will allow you to inspect any LDAP node and see all its properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Select sets the bit corresponding to the file descriptor in… May 16, 2026 at 5:18 pm
  • Editorial Team
    Editorial Team added an answer You might want to wrap that whole chunk of code… May 16, 2026 at 5:18 pm
  • Editorial Team
    Editorial Team added an answer With the image that you presented, there are so many… May 16, 2026 at 5:18 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

So I've never done any assembly programming (although I did some reading/reasoning out the
While reading some programming books, I notice that the authors says that, in OOP,
I was doing some .NET programming in WPF which involved reading .png and .txt
Once when I was reading some python docs I came across a reference to
I'm reading Fowler Clean Code book and I think that my code is a
I have started to do some programming using VIM. I have very mixed feelings
i did some finding and found theres a project markdown sharp which is used
I remember that for about a year ago I did some merges that resulted
I'm very new to programming and I'm just starting to learn VBA with excel.
I am new to C and I was reading about how pointers point to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.