Solved

Unable To Write to Active Directory Via ASP.NET Web Application

Posted on 2013-11-28
1
585 Views
Last Modified: 2014-03-20
Problem: After upgrading from Windows 2003 (IIS 6)to Windows 2008 R2 (IIS 7.5) .NET ASP.NET Utility used to add remove users from Active Directory via .NET Web Application is  no longer working.

Question1: As for as security is concerned would this be best practices?
Question2: Would there be a better solution than using ASP.NET Impersonation with an AD service account?

Additional Info:  The Admin utility is used to add/remove AD users (Group Memberships) for the web application. The utility calls a DLL (located in C:\Windows\assembly called “COVNET.Corp.AD”) to interface to AD.
The AD utility is unable to write to AD (but able to read).
All servers involved are member of the same AD Domain.

Current Bypass Solution: Configure Application to use ASP.NET Impersonation with an AD user account (domain\xyz). Ultimately configure this at site level so all applications could be managed by utility.


Detailed Error received when adding/removing user to AD via utility:
An operations error occurred.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: An operations error occurred.


Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[COMException (0x80072020): An operations error occurred.
]
   System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +378094
   System.DirectoryServices.DirectoryEntry.Bind() +36
   System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
   System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) +78
   System.DirectoryServices.DirectorySearcher.FindAll() +9
   COVNET.Corp.AD.AdAdapter.PopulateSearchResults(String filter) +215

[ADException: An operations error occurred.
]
   COV.Corp.HazardousMaterialTracking.Web.Admin.gdvUser_RowCommand(Object sender, GridViewCommandEventArgs e) in C:\JaredWorkspace\HazardousMaterialTracking\HMT\Main\Source\HMT\COV.Corp.HazardousMaterialTracking.Web\Admin.aspx.cs:181
   System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs e) +108
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +112
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
0
Comment
Question by:COV-Webmaster
1 Comment
 
LVL 10

Accepted Solution

by:
Pramod Ubhe earned 500 total points
ID: 39684803
Question1: depends on your company policy but not a recommend method.
Question2: Yes, using a service account is a common/recommended/helpful method.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A safe way to clean winsxs folder from your windows server 2008 R2 editions
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question