Last post Jun 08, 2020 06:54 AM by janpokorski
Jun 05, 2020 09:36 AM|janpokorski|LINK
my team is using a program written in C# to read all users from a specific OU. The program behaves very strange. Sometimes it is working for a couple of weeks and then without any big changes on our AD or any other related component, it throws an exception.
Then it is not working for a couple of weeks and after some time it start to run normally again.
DirectoryEntry searchRoot = new DirectoryEntry("<LDAP string>")
searchRoot.AuthenticationType = AuthenticationTypes.None;
DirectorySearcher search = new DirectorySearcher(searchRoot);
search.Filter = <our filter>;
search.PageSize = 1;
SearchResultCollection resultCol = null;
resultCol = search.FindAll();
catch (Exception ex)
if (resultCol != null)
Console.WriteLine("Result Count: " + resultCol.Count); //.Count throws the Exception
Unhandled Exception: System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.
I have come to a point, where I have no more ideas on solving this problem. I would appreciate all your support.
Thanks in advance
Jun 08, 2020 06:54 AM|janpokorski|LINK
can you please delete this thread? I couldn't find any button to do it myself. While I was waiting for approval, a Stackoverflow user helped me to find a solution.