An Operations Error Occured
Hi,
I am having problems adding groups to my applications via the 'Access Permissions' tab. When I click 'Add...' I get an message dialog stating 'An operations error occured.'.
When I click OK the 'Add/Edit User Group' dialog appears but I am unable to access the domain groups. The following is from the sftmmc.log file
ManagementConsole.MCException: An operations error occurred.
---> System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred.
Server stack trace:
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindAll()
at SoftGrid.Management.DataAccess.AdAccountQueries.SearchDirectory(AccountObjectData parent, String filter, SearchScope scope)
at SoftGrid.Management.DataAccess.AdAccountQueries.GetGroups(AccountObjectData parent, AccountObjectData[]& subContainers, AccountObjectData[]& groups)
at SoftGrid.Management.DataAccess.AccountQueries.GetGroups(AccountObjectData parent, AccountObjectData[]& subContainers, AccountObjectData[]& groups)
at SoftGrid.Management.Accounts.GetGroups(AccountContainer parent, AccountContainer[]& subContainers, AccountGroup[]& groups)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SoftGrid.Management.IAccounts.GetGroups(AccountContainer parent, AccountContainer[]& subContainers, AccountGroup[]& groups)
at ManagementConsole.ManagementSession.GetGroups(AccountContainer parent, AccountContainer[]& subContainers, AccountGroup[]& groups)
--- End of inner exception stack trace ---
has anyone seen this before, as I am now no longer able to perssion applications.
Thanks,
Andy
Todas las respuestas
I have seen this error on websites that has impersonation set to true in the web.config file with NTLM or Kerberos authentication set. (due to the fact that the users token is a "secondary token" that cannot be used when authenticating against another server)
You could either use Basic Authentication or switch the impersonation setting to false in web.config (which might break the app)
I have a small blogentry about the error when seen in sharepoint, but I guess that you're not going to change the code..

http://sharepoint-tweaking.blogspot.com/2007/12/impersonation-in-aspnet-causes.html
I found one of the error codes 0x80072020 may point to a problem contacting/communicating with the AD. Anything out of the ordinary in the Event logs or the SFT logs?
Switching to Basic Authentication did the Trick but it is not a very good solution. As automatic login will not work anymore.
I'm generating a Self Service Application where users can Alter some of their AD Properties.
So this is really very annoying.
BR
Daniel- Hi Daniel,
I'm having the exact same problem. Did you find a solution that did not require Basic Authentication?
Thanks for any help!
Tim PerG wrote: I have seen this error on websites that has impersonation set to true in the web.config file with NTLM or Kerberos authentication set. (due to the fact that the users token is a "secondary token" that cannot be used when authenticating against another server)
You could either use Basic Authentication or switch the impersonation setting to false in web.config (which might break the app)
I have a small blogentry about the error when seen in sharepoint, but I guess that you're not going to change the code..
http://sharepoint-tweaking.blogspot.com/2007/12/impersonation-in-aspnet-causes.html
I was using Windows Authentication for hosting my intranet site. In my web.config file is was
<authentication mode="Windows"/>
<identity impersonate="true"/>But still it was not working and error was showing on dirSearch.FindOne(); since I was using Directory search in Active Directory for user authentication. Your code below works properly to send user credential in SQL Server and now I am able to use User_Name keyword in sql server. It gets the user name what we authenticate from domain users.
using System.Web.Hosting;
...
...// Code here runs as the logged on user
using (HostingEnvironment.Impersonate()) {
// This code runs as the application pool user
DirectorySearcher searcher ...
}Thank you very much!.
- Propuesto como respuestaSyed Azharuddin jueves, 08 de enero de 2009 12:32
Thanks a million yar, you saved me, I was really worried about the issue..
using(HostingEnvironment.Impersonate())
{
code ..... blah blah blah...
}
solved my problem...- You're a genius! Thanks so much!
- Thanks man, you saved my whole day or might me more :)
It was bang on the target. - Hi vijander,
i have same problem in the with my vb.net code.
here is my code..
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim
m_LoginName As String = Environment.UserName.ToString
Dim dirEntry As System.DirectoryServices.DirectoryEntry
Dim dirSearcher As System.DirectoryServices.DirectorySearcher
dirEntry = New System.DirectoryServices.DirectoryEntry(LDAP://abc.com)
dirSearcher = New System.DirectoryServices.DirectorySearcher(dirEntry)
dirSearcher.Filter = "(samAccountName=" & m_LoginName & ")"
Dim sr As SearchResult = dirSearcher.FindOne()
Dim de As System.DirectoryServices.DirectoryEntry = sr.GetDirectoryEntry()
Dim sUserName As String = de.Properties("GivenName").Value.ToString()
Dim sLName As String = de.Properties("Sn").Value.ToString()
Lgname1.Text = "Welcome : " & sUserName & " " & sLName
End Sub
lines in my web.config file are..
<authentication mode="Windows"/>
<identity impersonate="true"/>
Could you please hlep me how do i overcome the issues.. using... (HostingEnvironment.Impersonate())
do i need to add this in my code page.. please help me here ...
-Ravi. - Add the code you've written in the
using(HostingEnvironment.Impersonate()) block like:
using(HostingEnvironment.Impersonate())
{
m_LoginName As String = Environment.UserName.ToString
Dim dirEntry As System.DirectoryServices.DirectoryEntry
Dim dirSearcher As System.DirectoryServices.DirectorySearcher
dirEntry = New System.DirectoryServices.DirectoryEntry(LDAP://abc.com)
dirSearcher = New System.DirectoryServices.DirectorySearcher(dirEntry)
dirSearcher.Filter = "(samAccountName=" & m_LoginName & ")"
Dim sr As SearchResult = dirSearcher.FindOne()
Dim de As System.DirectoryServices.DirectoryEntry = sr.GetDirectoryEntry()
Dim sUserName As String = de.Properties("GivenName").Value.ToString()
Dim sLName As String = de.Properties("Sn").Value.ToString()
Lgname1.Text = "Welcome : " & sUserName & " " & sLName
}
Hope it works!! - My friend, it works very well!! Thank you so much!