Created
December 20, 2014 14:22
-
-
Save rheid/d1280da208b9aea17fb3 to your computer and use it in GitHub Desktop.
Setup IIS Timeout and Workflow Timeout für SharePoint 2013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "===============================================" -ForegroundColor Yellow | |
Write-Host "Adding Timout Value to SharePoint Web.Config" -ForegroundColor Yellow | |
Write-Host "===============================================" -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
function RemoveMyEntries($webapp, $Owner) | |
{ | |
$oldMods = @(); | |
$webapp.WebConfigModifications | where-object { $_.Owner -eq $Owner } | foreach-object { $oldMods = $oldMods + $_} | |
Write-Host $oldMods.Count "Items Found" | |
$oldMods | foreach-object { $webapp.WebConfigModifications.Remove($_) } | |
#$webapp.Update() | |
#$webapp.Parent.ApplyWebConfigModifications() | |
} | |
$Owner = "SPTimeOut" | |
$WebApp = Get-SPWebApplication http://rh-sp2013-dev1 | |
Write-Host $WebApp | |
#Write-Host "Removing All Entries Made by $Owner" | |
RemoveMyEntries $WebApp $Owner | |
sleep -Seconds 10 | |
#Write-Host "Removed All Entries Made by $Owner" | |
Write-Host "Creating New Entry" | |
$configMod = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification | |
$configMod.Name = "executionTimeout" | |
$configMod.Path = “configuration/system.web/httpRuntime” | |
$configMod.Value = "300" | |
$configMod.Sequence = 0 | |
$configMod.Type = 1 #for enum value of SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode | |
$configMod.Owner = $Owner | |
$configMod2 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification | |
$configMod2.Name = "TransAction" | |
$configMod2.Path = “/configuration” | |
$configMod2.Value = "<system.transactions><defaultSettings timeout='00:15:00' /></system.transactions>" | |
$configMod2.Sequence = 0 | |
$configMod2.Type = 0 #for enum value of SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode | |
$configMod2.Owner = $Owner | |
$WebApp.WebConfigModifications.Add($configMod) | |
$WebApp.WebConfigModifications.Add($configMod2) | |
$WebApp.Update() | |
$WebApp.Parent.ApplyWebConfigModifications() | |
Write-Host "Web Application Entry has been added. Wait for a couple of minutes and then test it out" -ForegroundColor Green |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment