Skip to content

Instantly share code, notes, and snippets.

@davops
Created April 4, 2016 19:44
Show Gist options
  • Save davops/ecde130fe609bcb5cb2c81fcc4f58401 to your computer and use it in GitHub Desktop.
Save davops/ecde130fe609bcb5cb2c81fcc4f58401 to your computer and use it in GitHub Desktop.
#Verify IIS Settings using PowerShell v3
Import-Module Webadministration
$appName = (Get-ChildItem -Path IIS:\apppools).name
foreach($appPool in $appName)
{
#Rapid Fail Protection
$rapid = (Get-Item "IIS:\AppPools\$appPool").failure.rapidFailProtection
if (!($rapid -eq "True"))
{Write-Host "Error: The rapid fail protection for $appPool is $rapid." -ForegroundColor Yellow}
#Idle Timeout
$idle = (Get-Item "IIS:\AppPools\$appPool").processModel.idleTimeout
if (!($idle -eq "00:20:00"))
{Write-Host "Error: The idle Timeout for $appPool is $idle" -ForegroundColor Yellow}
#Queue Length
$queue = (Get-Item "IIS:\AppPools\$appPool").queueLength
if (!($queue -eq "1000"))
{Write-Host "Error: The queueLength for $appPool is $queue" -ForegroundColor Yellow}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment