Thursday, July 12, 2012

SPFarmConfig PowerShell command

Introduction:
In this article we will discuss details about the SPFarmConfig powershell command, what we can do with this command. Also you can check my last article on creating web application, site collections and creating sub sites by using PowerShell here.

You can also check one good article on difference between Standard windows PowerShell and
SharePoint 2010 management shell here.

Description:
PowerShell is very much effective in SharePoint 2010, lots of things you can do using PowerShell like deploying web parts, features etc. If you want to check your farm level configurations then SPFarmConfig PowerShell command will be very much helpful. Through this command you can view the settings as well as you can change the farm level settings.

Get-SPFarmConfig:
This command will show details about: [Also refer figure below]
WorkflowBatchSize:
This is the size that determines number of events processed for a single workflow instance. Default value is 100, but it can be range from 1 to any number.
WorkflowPostponeThreshold:
This decides how many workflows can operate at same time. Default value is 15 and it can be any number.

WorkflowEventDeliveryTimeout:
This decides the time out of the workflow event. The defalut value is 5 and can be any interger. The time is in minute.

DataFormWebPartAutoRefreshEnables:
This boolean value determines whether the data form web parts on the SharePoint web pages are allowed to automatically refresh using the asynchronous Ajax settings. Default value is TRUE.

AspScriptOptimizationEnabled:
This boolean value determines whether ASP scripting is allowed to be optimized by IIS and the default value is TRUE.

All these values can also be changed by using SPFarmConfig powershell command like below:

Set-SPFarmConfig –ASPScriptOptimizationEnabled:$true
–DataFormWebPartAutoRefreshEnabled:$false –WorkflowBatchSize 500
–WorkflowEventDeliveryTimeout 60 –WorkflowPostponeThreshold 20

The above command will change the WorkflowBatchSize, WorkflowPostponeThreshold, WorkflowEventDeliveryTimeout to the specified values from the default values. And it will disable DataFormWebPartAutoRefreshEnabled.