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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:53:44+00:00 2026-06-16T22:53:44+00:00

I am developing an Intranet application and have successfully integrated with Active Directory. When

  • 0

I am developing an Intranet application and have successfully integrated with Active Directory.

When we add a new customer I would like to assign a Customer Advisor from a dropdown list.

I am able to populate the dropdown list using the following

PrincipalContext pc = new PrincipalContext(ContextType.Domain, "DOMAIN", "dc=domain,dc=org");
GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, "customerAdvisors");
ViewBag.Guid = new SelectList(group.Members, "Guid", "DisplayName");

I would like to then store the Guid of the selected user along with the Customer data in the database.

However, I am unsure of how to setup foreign key constraints in my Model as the table I am joining to is within Active Directory.

Do I need to create a separate Employee table within my DB and sync the required fields or is there a simplified way of doing this?

  • 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-06-16T22:53:45+00:00Added an answer on June 16, 2026 at 10:53 pm

    I’ve never done this but some quick research makes it look possible.

    You could just save the Guid for your adviser on your Customer. The AD Guid can go into the Guid data type. You should be able to query individual users by using this method:

    UserPrincipal user =
    UserPrincipal.FindByIdentity(pc, yourUsersGuidAsAString);

    The down side is that every time you want your customer adviser’s info (like their name or email address) you will have to do a separate query to AD. Harder to use ORM.

    In my application I have a different use case, but I have also integrated my application with AD. The route that I took was to save this information in my own DB instead of hitting AD every time. In large part because my architecture makes it hard to get to AD in the same way you can. Also it’s easier to use ORM (like entity framework in my case) to pull in the information that I want. The downside to this is then you need to ensure that the information you have in your database is reasonably up to date with what’s in AD.

    You will have to make the judgement on which approach makes the most sense for your architecture/use case.

    Hope that helps.

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

Sidebar

Related Questions

I am developing an intranet web application which is a Quiz Engine. I have
I am developing an ASP.NET intranet application that needs to have an interactive map
I am developing a small intranet based web application. I have YSlow installed and
I am developing a web application (intranet) and it is mandatory to watch a
I have a question about implementing WYSIWYG editors into CakePHP. I'm developing an intranet
I'm developing an ASP.NET application for an intranet site that is using Windows/NTLM/WIA/whatever authentication.
I’m developing an Intranet application and I want to make a secure authentication. One
I am developing an ASP.NET intranet web application that provides short quizzes to the
I'm currently developing application using DirectSound for communication on an intranet. I've had working
I'm developing an intranet application. The application is working on an IIS on a

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.