1. 设置iis pool:
cls
Import-Module WebAdministration Get-ChildItem IIS:\apppools | ForEach-Object{ $name = $_.name Write-Host $_.name$pool = Get-Item IIS:\AppPools\$name
$pool.recycling.periodicRestart.time = [TimeSpan]::Zero $pool | Set-ItemClear-ItemProperty "IIS:\AppPools\$($pool.Name)" -Name recycling.periodicRestart.schedule
Set-ItemProperty "IIS:\AppPools\$($pool.Name)" ` -Name recycling.periodicRestart.schedule -Value @{value='01:01:00'} }
2. 设置startup time limit
#Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-ChildItem IIS:\apppools | ForEach-Object{ C:\windows\system32\inetsrv\appcmd set apppool $_.name /processModel.startupTimeLimit:00:10:00 }