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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:14:27+00:00 2026-06-05T05:14:27+00:00

Active Directory (AD DS) has a concept of ‘read-only domain controllers’ (RODC). Probably for

  • 0

Active Directory (AD DS) has a concept of ‘read-only domain controllers’ (RODC). Probably for backward compatibility, the default is that read-only domain controllers are ignored: you have to specify explicitly that you allow connecting to a read-only domain controller.

In our C# code we see that at two places. One is when creating a new System.DirectoryServices.DirectoryEntry: there the problem is easily solved by setting the System.DirectoryServices.AuthenticationTypes.ReadonlyServer flag, which allows an RODC to be used.

My question is how to achieve the same thing for code like the following, which uses classes from the System.DirectoryServices.AccountManagement namespace:

using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain))
using (UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(
                                                      ctx,
                                                      IdentityType.SamAccountName,
                                                      ...))
{
    // ...
}

since we observed that this code ignores any read-only domain controllers.

(Note that the above is exactly the same question as posted at the MSDN “Visual C# General” forum in a thread entitled “Issue connecting to read-only domain controller (RODC) from C# application through System.DirectoryServices.AccountManagement”.)

  • 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-05T05:14:29+00:00Added an answer on June 5, 2026 at 5:14 am

    Most likely what happened was this was over looked as this functionality doesn’t exist. If it wasn’t over looked then it was intentional, as a RODC wouldn’t allow you to do many of the methods that exist on a UserPrincipal (eg ChangePassword, Delete, etc). I would imagine that to solve this problem, Microsoft would have to create a new ReadOnlyUserPrincipal. More importantly, why would it make sense to instantiate anything in the System.DirectoryServices.AccountManagement namespace as read only as the namespace appears to be more than a read only service (for lack of a better term), unless a read-only version didn’t exist (which is the case). Hence, using a non-read only sevice and pointing it to a read only source doesn’t work.

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

Sidebar

Related Questions

Infrastructure has created an active directory account for me that has read access to
We have ColdFusion and Active Directory running within the same domain. I'm trying to
I want to authenticate Thread.CurrentPrincipal.Identity when it has entry in active directory or redirect
I have created an Active Directory client using JNDI, that has the ability to
I have two Active Directory domains, A and B. Users in domain A need
I have some WebSphere instances for which Active Directory has been connected for LDAP
I have managed to query my Active Directory Domain Controller for user info using
Az you know every user that is defined in active directory has FirstName,LastName ,UserLoginName(sAMAccountName),Email,....
Has anyone implemented Active Directory verification instead of SQL Server with this framework? Where
Has anyone seen any solid libraries for working with active directory (mainly user related

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.