Share via


LDAP Directory Error Message The server is not operational.

Question

Wednesday, December 14, 2011 2:43 AM

HI Folks,

 

I am getting Error While Connection to LDAP AD intermittenlty. out of 200 times the search called it is Returning this  Error Message  The server is not operational only 20 to 25   Seraches  and remaing all searche are sucussfull for the same Input. Not able to figure it out why it is failed for some Trnasactions only as the LDAP path and Credentials are same for all Searches

The error Message is:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'  The server is not operational
 

 Can any one PLs share some input on this why LDAP is thowring this Error

          try 
            { 
                DirectoryEntry de = new DirectoryEntry(URI, Username, Pwd, AuthenticationTypes.None); 
                DirectorySearcher dsearch = new DirectorySearcher(de);
                dsearch.ClientTimeout = new TimeSpan(0, 0, 30); 
                dsearch.Filter = string.Format("accountId={0}", AccId); 
                dsearch.SearchScope = SearchScope.Subtree; 
                SearchResult sr = null; 
                sr = dsearch.FindOne();
                if(sr!== null 
                { // code to cross validate User Input }
                } 
            }
            catch (Exception ex) 
            { throw ex; }  
            finally 
            { 
                if (de != null) 
                    de.Dispose(); 
                if (dsearch != null) 
                    dsearch.Dispose(); 
            } 
            
            URI: LDAP://ldap***.****.com:****/o=*****.com/ou=people Username: uid=*****, ou=*********, o=*****.com Pwd: ******

All replies (4)

Thursday, December 15, 2011 7:35 PM ✅Answered | 1 vote

Hi argia,

       The exception "The server is not operational" is normally returned when server is not in network or switched off.

 

But there are special cases that you may receive the error .

When you try to access the attribute like GUID,Tokengroups... continuosly you may recive the exception. So inorder to avoid this try refreshing the cache... Like below 

 DirectoryEntry de = new DirectoryEntry(URI, Username, Pwd, AuthenticationTypes.None);
de.RefreshCache(); ' to refresh all attributes
(or) for particular attribute
de.RefreshCache(New String()
{"accountId"});

If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful". Happy Coding...


Friday, December 16, 2011 5:37 AM ✅Answered

Hi Ariga,
Welcome to the MSDN forum!

**Check the ErrorCode property of the exception to determine the HRESULT returned by the COM object
**When the runtime encounters an unfamiliar HRESULT, it throws a COMException exception, which includes a public ErrorCode property that contains the HRESULT returned by the call. If an error message is available to the runtime, the message is returned to the caller. However, if the COM component developer fails to include an error message, the runtime returns the eight-digit HRESULT in place of a message string. Having an HRESULT allows the caller to determine the cause of the exception. For more information, see How to: Map HRESULTs and Exceptions.

**Disable the hosting process.
**COM is used to communicate between Visual Studio and the hosting process. Because it is used before code runs, a call to CoInitializeSecurity causes this exception to be thrown.

Please refer to the following link for more detals:

Troubleshooting Exceptions: System.Runtime.InteropServices.COMException
http://msdn.microsoft.com/en-us/library/af1y26ew(v=VS.100).aspx

 

Please refer to the following links at the same time:

"The server is not operational" error message when you try to open Exchange System Manager
http://support.microsoft.com/kb/325322

**LDAP searches and "The Server is not operational" intermittent errors **
http://social.msdn.microsoft.com/Forums/en/Vsexpressvcs/thread/45ddb7e3-a8e1-4a14-9779-44089dbd79f9

System.DirectoryServices and connection pooling
http://blogs.dirteam.com/blogs/tomek/archive/2007/08/09/system-directoryservices-and-connection-pooling.aspx

Troubleshoot "The Server Is Not Operational" errors
http://www.techrepublic.com/article/troubleshoot-the-server-is-not-operational-errors/5549891

COMEXception (0x8007203a): The server is not operational - fixed
http://social.msdn.microsoft.com/forums/en-US/tfsgeneral/thread/ed25f650-fe45-4a9c-8ac9-7d18d16ba05b

DYNAMICS CRM COMEXCEPTION: THE SERVER IS NOT OPERATIONAL
http://weblogs.asp.net/pabloperalta/archive/2011/12/22/dynamics-crm-comexception-the-server-is-not-operational.aspx

Have a nice day!

 

Yoyo Jiang[MSFT]
MSDN Community Support | Feedback to us


Thursday, December 15, 2016 5:09 AM

Hi,

I have some problem in connecting LDAP with SSL,

Im trying to connect LDAP With SSL encryption using the DSO object in UFT. When Im connecting the LDAP connection manually it connecting , but connecting the code via UFT im getting an error like "Server is not operational" . Im using VBS here.
The same code is worked for other connections but it doesn't have SSL.

But trying to connect SSL for other connection im getting the "Server is not operational " error. Kindly help me to resolve the issue.
Please find the sample code I have used

"Dim oDS: Set oDS = GetObject("LDAP:")
Dim oAuth: Set oAuth = oDS.OpenDSObject("LDAP://Ip address:1636/cn=xxx-adm,ou=Human,o=Admin","xxx-adm","Password",1)


Friday, November 9, 2018 3:57 AM

I do not understand your language.