Overview

The SharePoint Web application has a number of settings that you can customize to configure your environment the way that suits your needs best. There are a number of different group: General, Resource Throttling, Workflow, Email, etc. All of these settings can be configured through PowerShell. These settings are available through the Microsoft.SharePoint.Administration.SPAdministrationWebApplication object. In order to modify these settings, we simply need to use the Get-SPWebApplication cmdlet and then make the changes we need. In order to save the changes, you must call the Update() method.

 

The Script

$siteURL = http://lab.ps4sp.com”

$webApp = Get-SPWebApplication $siteURL

 

# General Settings

$webApp.DefaultTimeZone = 12; # Mountain Time

$webApp.PresenceEnabled = $true

$webApp.AlertsEnabled = $true

$webApp.AlertsMaximum = 500

$webApp.SyndicationEnabled = $true

$webApp.MetaWeblogEnabled = $false

$webApp.MetaWeblogAuthenticationEnabled = $true

$webApp.BrowserFileHandling = [Microsoft.SharePoint.SPBrowserFileHandling]::Strict; # Permissive or Strict

$webApp.SendLoginCredentialsByEmail = $false

$webApp.MasterPageReferenceEnabled = $true

$webApp.MaximumFileSize = 100

$webApp.RecycleBinEnabled = $true

$webApp.RecycleBinCleanupEnabled = $true

$webApp.RecycleBinRetentionPeriod = 15

$webApp.SecondStageRecycleBinQuota = 25

$webApp.BrowserCEIPEnabled = $false

# Resource Throttling

$webApp.MaxItemsPerThrottledOperation = 5000

$webApp.MaxItemsPerThrottledOperationOverride = $true

$webApp.MaxItemsPerThrottledOperationWarningLevel = 2000

$webApp.MaxListItemRowStorage = 8

$webApp.MaxQueryLookupFields = 0

$webApp.DailyStartUnthrottledPrivilegedOperationsHour = 17

$webApp.DailyStartUnthrottledPrivilegedOperationsMinute = 0

$webApp.DailyUnthrottledPrivilegedOperationsDuration = 1

$webApp.IsBackwardsCompatible = [Microsoft.SharePoint.TriState]::false

$webApp.ChangeLogExpirationEnabled = $false

# Workflows

$webApp.UserDefinedWorkflowsEnabled = $true

$webApp.EmailToNoPermissionWorkflowParticipantsEnabled = $true

$webApp.ExternalWorkflowParticipantsEnabled = $false

# Email

$webApp.OutBoundMailReplyToAddress = “administrator@ps4sp.com”

$webApp.OutboundMailSenderAddress = “administrator@ps4sp.com”

$webApp.IncomingEmailServerAddress = “mail.ps4sp.com”

# Designer

$webApp.AllowDesigner = $true

$webApp.AllowRevertFromTemplate = $true

$webApp.AllowMasterPageEditing = $true

 $webApp.ShowURLStructure = $true
$webApp.Update()

Advertisements

One thought on “Modify Web Application Settings with PowerShell

  1. First off, I love the post!
    I do have a few comments though.
    MaxItemsPerThrottledOperationOverride = $true should be a number not a boolean value.

    I added the below line also:
    $webApp.ChangeLogRetentionPeriod = “30”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s