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

Related Questions

So I've never done any assembly programming (although I did some reading/reasoning out the
I did some research but all I could find was syncing data core with
While reading Programming Ruby , I ran across this code snippet: while gets num1,
I took Computer Networking last semester and did some C programming in linux (using
While reading some programming books, I notice that the authors says that, in OOP,
10 years ago I did some game programming and used OpenGL for the 3d
I am getting into GUI programming and did some research. Now not everything is
I did some programming with Java and C# and they both have great GUI
I was doing some .NET programming in WPF which involved reading .png and .txt
I'm almost a complete beginner at programming (only did some basic a long time

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.