IIS 6 AppPool Worker Process Monitoring and Recovery with SCOM and Orchestrator

Published on
11,052 Points
1 Endorsement
Last Modified:
Hi Everyone

Now IIS AppPool issues is something we have always had because of the amazing custom development and in-house applications we have :)

The issues we had were getting out of control and it was time to do something about it, just for my sanity.

The problem was that we had our worker processes running high CPU and there were a lot of them and the support teams needed a way to see which worker processes belonged to which application pool as well as have some way of recycling these automatically at the same time sending out a mail notification about which application pool was recycled and when.

So I created a custom SCOM management pack to collect the worker process CPU usage as well as which W3WP.exe ID was tied to which AppPool and then plot this in a performance view as well as create a consecutive samples monitor to alert when these worker processes were over 85% for 2 samples or more.

Below is a screen shot of one of the alerts:
Worker Process AlertWhat I also did, was create a "recovery" script to fire off a Orchestrator Runbook so that I could automatically recycle that specific application pool for them and then send them a mail with all the same details.

Below is the actual Runbook
Recycle AppPool
Simple !

The Runbook "Initialize Data" accepts the 2 parameters "Server" and "AppPoolName" this is then passed to the "Recycle App Pools" activity which runs the PowerShell script that will recycle that specific application pool.

$Server = "ServerName"
$AppPoolName = "AppPoolName"
$iisVersion = Get-ItemProperty "HKLM:\software\microsoft\InetStp";
if ($iisVersion.MajorVersion -eq 7)

$Name = "W3SVC/APPPOOLS/$AppPoolName"
$Path = "IISApplicationPool.Name='$Name'"
Invoke-WMIMethod Recycle -Path $Path -Computer $Server -Namespace root\MicrosoftIISv2 -Authentication PacketPrivacy
$appPool = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPool" | Where-Object {$_.Name -eq "W3SVC/APPPOOLS/$AppPoolName"}

Open in new window

The normal things can be done to create your views in SCOM so that the guys can look at the performance view of their specific servers AppPools as well as Alerts as per the normal setup you would do.

If you would like any more info on this simple process or any questions, please feel free.

Thank you

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Join & Write a Comment

Key to your CPU's ability to stay cool is to use the right amount of thermal paste and apply it correctly. In other words you want as much thermal conductivity between CPU and the cooling block. Use a quality thermal paste and apply it in a manner…
Learn how to collaborate with office 365 Office Online

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month