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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:16:29+00:00 2026-06-17T08:16:29+00:00

Apologies for duplicate of System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred but I can’t comment yet

  • 0

Apologies for duplicate of System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred but I can’t comment yet and there’s no answer.

The solution from this question, did not work. Error on publishing: System.DirectoryServices.DirectoryServicesCOMException

I’ve got a new ASP.NET MVC 3 web application project with Razor view engine in Visual Studio 2010. It is as generated with the addition of two lines of code added to the home controller and the System.DirectoryServices.AccountManagement reference added to the project.

This runs just fine on my local PC, but I get an error on a Windows 2008 R2 IIS 7.5 site I’ve created.

The site uses the defaultAppPool, which is using ApplicationPoolIdentity. The root site folder has been granted IUSR and IIS AppPool\DefaultAppPool read permissions.

The two lines of code in the controller are:

PrincipalContext context = new PrincipalContext(ContextType.Domain);
ViewBag.name = UserPrincipal.FindByIdentity(context, User.Identity.Name).DisplayName;

The error I get is:

System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.

Stack Trace:

[DirectoryServicesCOMException (0x80072020): An operations error occurred.]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +781
System.DirectoryServices.DirectoryEntry.Bind() +44
System.DirectoryServices.DirectoryEntry.get_AdsObject() +42
System.DirectoryServices.PropertyValueCollection.PopulateList() +29
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +119
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +163
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()
+535649
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit() +51
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize() +141
System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx() +42
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable1 identityType, String identityValue, DateTime refDate) +27
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext
context, String identityValue) +95
ActiveDirectory.Controllers.HomeController.Index() in C:\projects\ActiveDirectory\ActiveDirectory\Controllers\HomeController.cs:18
lambda_method(Closure , ControllerBase , Object[] ) +79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
2 parameters) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary2
parameters) +39
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +125
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func
1 continuation) +640
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext
controllerContext, IList1 filters, ActionDescriptor actionDescriptor,
IDictionary
2 parameters) +312
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext, String actionName) +691
System.Web.Mvc.Controller.ExecuteCore() +162
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305
System.Web.Mvc.<>c__DisplayClassb.b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +20
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+469
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

Be nice, it’s my first question!

  • 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-17T08:16:29+00:00Added an answer on June 17, 2026 at 8:16 am

    Most likely this is a permissions issue. Check that the account the App Pool is running under has the authority to perform these Active Directory calls. If it’s a local machine account, it probably won’t.

    You can find more information here: http://msdn.microsoft.com/en-US/library/ms180891(v=vs.80).aspx

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

Sidebar

Related Questions

Straightforward question - apologies if it is a duplicate, but I can't find the
Apologies if this is a duplicate question, but is there a real difference between
Apologies if this question is a duplicate, or if I've missed something, but in
Apologies, this is a duplicate of entry of this post but I found I'm
Apologies if this is a duplicate, but I've not managed to find this question
apologies if this is a duplicate. Is there any way to determine what generic
My apologies if this is a duplicate question, but I haven't come across anything
Possible Duplicate: efficient word indexing in python Apologies for the basic question, how can
Apologies, this is almost certainly a duplicate of this question but as that one
(apologies if this is a duplicate ... i posted but saw no evidence that

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.