Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 553757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:38:18+00:00 2026-05-13T11:38:18+00:00

I am developing a SharePoint application which needs users from a specified Windows Server

  • 0

I am developing a SharePoint application which needs users from a specified Windows Server 2003 Active Directory Organizational Unit.

Firstly I wasn’t concerned about the ‘Dispose’ and ‘Close’ operations on DirectoryServices objects. In this point the retrieve operations were quick and successful.

But this was causing ‘Server is not operational’ error after 2ish attempts. And this error makes the whole application operates worse like stopping other AD operations.

Then, I corrected this error by adding using statements on every DirectoryEntry, DirectorySearcher and SearchResultCollection objects.

Then I have reached a point that I have no longer get ‘Server is not operational’ error. But when I try to retrieve users from AD 1 or more times by using DirectorySearcher.FindAll method, the first one operates quick and successfully, others more slowly but successfully. It kinda takes the duration of a timeout. Could you please help me with my situation about this slow down?

Here is the sample code:

using (DirectoryEntry directoryEntry = new DirectoryEntry(connectionString, userName, password))
            {
                using (DirectorySearcher search = new DirectorySearcher(directoryEntry))
                {
                    search.SearchScope = SearchLevel.OneLevel;
                    search.ReferralChasing = ReferralChasingOption.All;
                    search.Filter = filter;
                    search.SizeLimit = 200;
                    //Limits the property count for search result
                    SetUserDirectorySearcherPropertiesToLoad(search);

                    using (SearchResultCollection result = search.FindAll())
                    {
                        foreach (SearchResult searchResult in result)
                        {
                            // Get user attributes
                        }}}}

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:38:19+00:00Added an answer on May 13, 2026 at 11:38 am

    Everything seems to be normal here. I am using something similar, the only mentionable difference is that I usually pass the “propertiesToLoad” parameter to the constructor of DirectoryEntry, as well as I pass the filter to the constructor of DirectorySearcher.

    Another difference is that you are using “username” and “password” for the DirectoryEntry – maybe it’s worth using the application pool identity? I typically do SPSecurity.RunWithElevatedPrivileges(method pointer) for these calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SharePoint Server 2007 Enterprise with Windows Server 2003 R2 Enterprise. I
I'm developing a SharePoint 2010 Web Part (in C#) which needs to pull user
I am developing a Windows application that will allow SharePoint administrators to copy a
I am developing an application using sharepoint 2010 server side object model. Can anyone
Although I am currently developing this WinForms application on our Sharepoint server I intend
I'm developing a custom SharePoint solution which consist of a feature and a timer
While developing an application using gwt in ecliplse crashed. Now the server is running
My current project for work involves developing a SharePoint 2007 WebPart which will be
I'm developing a sharepoint 2010 application. One Part of these application is a List
I'm developing a Sharepoint 2007 application with Visual Studio 2008 / C#. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.