I have an ADLDS store and a webservice that can add users. The credentials are not in the web.config, but the app pool account has full control on the ADLDS.
I created a user succesfully with an active directory membershipprovider.
Now I want to set a property, so I try to retrieve the DirectoryEntry using the same connectionString as the membershipprovider (and pass Secure as the authenticationType), but as soon as it binds (System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail))
this error is thrown:
System.Runtime.InteropServices.COMException: The server is not operational
Its not liking something in your autentication for the DirectoryEntry. That message typically means there is something wrong in the connection string or the server you are trying to connect to cannot be reached, such as the domain controller is offline.
I think you issue may be with the membership provider not updating with the user you just created. I believe IIS caches the information used by membership provider so any recent changes are not updated in time. So it may see the directoryentry for the user
as invalid becuase it does not see that object on the server. You may try searching for the user then binding the result.path to your directoryentry.
You may need to create your user and update the properites using system.directoryservices. I work with a guy who made an application with membershipprovider but if a user was change it would not be reflected until after IIS was restarted.
Thanks, but that's not the issue. If I do an IISreset and try it again (without creating the user, but with an existing user) I get the exact same error message. If I check the ActiveDirectoryMembershipProvider code I see Microsoft uses an ActiveDirectoryConnectionHelper
(internal class) which passes a revertImpersonation boolean which is set to true. This creates a new ApplicationImpersonationContext which seems to impersonate the apppool account. Other then that I can find no big differences...
SilverSwan
Member
323 Points
62 Posts
System.Runtime.InteropServices.COMException: The server is not operational
Jul 29, 2011 02:06 PM|LINK
I have the following challenge:
I have an ADLDS store and a webservice that can add users. The credentials are not in the web.config, but the app pool account has full control on the ADLDS.
I created a user succesfully with an active directory membershipprovider.
Now I want to set a property, so I try to retrieve the DirectoryEntry using the same connectionString as the membershipprovider (and pass Secure as the authenticationType), but as soon as it binds (System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)) this error is thrown:
System.Runtime.InteropServices.COMException: The server is not operational
Any idea what I could be doing wrong?
gww
Contributor
2143 Points
458 Posts
Re: System.Runtime.InteropServices.COMException: The server is not operational
Jul 29, 2011 11:15 PM|LINK
Its not liking something in your autentication for the DirectoryEntry. That message typically means there is something wrong in the connection string or the server you are trying to connect to cannot be reached, such as the domain controller is offline.
I think you issue may be with the membership provider not updating with the user you just created. I believe IIS caches the information used by membership provider so any recent changes are not updated in time. So it may see the directoryentry for the user as invalid becuase it does not see that object on the server. You may try searching for the user then binding the result.path to your directoryentry.
You may need to create your user and update the properites using system.directoryservices. I work with a guy who made an application with membershipprovider but if a user was change it would not be reflected until after IIS was restarted.
SilverSwan
Member
323 Points
62 Posts
Re: System.Runtime.InteropServices.COMException: The server is not operational
Aug 01, 2011 10:43 AM|LINK
SilverSwan
Member
323 Points
62 Posts
Re: System.Runtime.InteropServices.COMException: The server is not operational
Aug 01, 2011 06:02 PM|LINK
The conclusion of a day debugging is:
Set the AuthenticationType to Encryption instead of Secure of the DirectoryEntry.
anwar232
Member
12 Points
11 Posts
Re: System.Runtime.InteropServices.COMException: The server is not operational
Nov 20, 2012 06:44 AM|LINK
I am having the same problem. I have changes that authentication type also still iam having that exception.
RadhikaY
Member
2 Points
1 Post
Re: System.Runtime.InteropServices.COMException: The server is not operational
May 03, 2013 02:58 PM|LINK
I was able to resolve this by specifying full DN for domain controllers.
For eg,
DirectoryEntry dEntry = new DirectoryEntry("LDAP://xxx.corpad.net/DC=xxx,DC=xxx,DC=net")