Azure / Office 365 / SharePoint Development / Search

Quiescing a SharePoint 2010 Farm as in SharePoint 2007

on Apr 05, 2011 by Elio Struyf with 2 comments

In SharePoint 2007 you had the ability to quiesce the farm inside central administration. This ability is not implemented in SharePoint 2010, you need to use the STSADM command to achieve this.

But, I have done some research and development to achieve the same as in SharePoint 2007. In this blog post I will explain you how you can quiesce your farm by code, and I deliver you my SharePoint 2010 Solution file that makes the same functionality as in SharePoint 2007 available.

QuiesceFarm Solution

Programming

To be able to start writing some code to quiesce your farm, you need to add the following reference to your project: "Microsoft.Office.Server.Administration".

The next step is to retrieve your farm "SessionStateService". This service allows you to quiesce the farm.

Session State Service

Session State Service



Now the only thing we need is to write some code to quiesce the farm and to stop the quiescing.

The code for quiescing the farm, looks like this:

The code to stop the quiescing of the farm, looks like this:

SharePoint 2010 Quiesce Solution

The solution that I have created enables you to quiesce the SharePoint 2010 farm through central administration. This solution is based on the SharePoint 2007 version.

  • Add and deploy the estruyf.QuiesceFarm solution to your farm;
  • Go to Central Administration -> Site Actions -> Site Settings;
  • Open the Manage site features page;
  • Activate: E. Struyf Quiesce Farm Feature;
  • Navigate to System Settings;
  • Under Farm Management, the Quiesce Farm option should be available.
    Quiesce Farm Option

    Quiesce Farm Option

Result

When the SharePoint farm is not quiesced, you receive the following screen.

Quiesce Normal State

Quiesce Normal State

When you quiesce the farm you will get the following results.

Farm in Quiescing state

Farm in Quiescing state

Farm Quiesced

Farm Quiesced

Download

QuiesceFarm Solution

VS2010 Project

Article comments

  • Great solution that is really needed in SharePoint 2010! I see the wsp file, but I don’t see a source code file. Can you send me the source code for this?
    Thanks!
    Julian

    • estruyf

      Julian,

      I have added my Visual Studio Project to the post. You could download it here: VS2010 Project.

      Regards,
      Elio