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 597625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:18:03+00:00 2026-05-13T16:18:03+00:00

I am running an ASP.Net page on IIS7, and developing in VS 2008. Currently,

  • 0

I am running an ASP.Net page on IIS7, and developing in VS 2008. Currently, I have user authentication being done through an LDAP connection. Once the user logs in, on one page they have a form with some basic information about them (such as their name, email address, country, and the like) and I wish to pre populate some of these fields from information already stored in the LDAP. In particular their given name and email addresses. The question is, using C#, how do I actually retrieve this information?

  • 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-13T16:18:04+00:00Added an answer on May 13, 2026 at 4:18 pm

    Sounds like you’re on .Net 3.5 SP1, in that case you can use the System.DirectoryServices.AccountManagement namespace that greatly simplifies this.

    Here’s a sample:

    var pc = new PrincipalContext(ContextType.Domain, "mydomaincontroller");
    var u = UserPrincipal.FindByIdentity(pn, userName);
    var email = u.EmailAddress;
    var name = u.DisplayName;
    

    Here’s a full list of properties you can grab.

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

Sidebar

Related Questions

We currently have a Live ASP.NET application (Basically a CMS) running on our IIS7
I have an ASP.NET 3.5 website running under IIS7 on Windows 2008. When I
I am trying out Silverlight's Isolated Storage feature. Currently running Silverlight thru ASP.NET page.
I am running ASP.NET MVC Beta. I have an AJAX call running through jQuery
We have an ASP.NET 3.5 app running in IIS6 we're migrating to IIS7 &
I have Windows 7 professional running IIS7. I have installed ASP.NET MVC 1.0 and
I currently have an ASP.NET 3.5 SP1 running on IIS 7. I have enabled
I have an ASP.NET MVC application running on IIS7. I use sessions to keep
I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site
I have a one page ASP.NET 4.0 C# script running. In debug mode my

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.