AD FS application pool Is Not Running On The Federation Server Proxy

Microsoft.ActiveDirectoryFederationServices20.FederationServerProxyWebsitesIISMonitor (UnitMonitor)

Knowledge Base article:

Summary

The AD FS application pool (ADFSAppPool) is stopped in IIS Manager on the federation server proxy.

If ADFSAppPool is running on IIS, the monitor will change to a Green state and the original warning alert will be resolved automatically.

Causes

The AD FS application pool was stopped manually.

Resolutions

Start the AD FS application pool using the IIS Manager snap-in.

Element properties:

TargetMicrosoft.ActiveDirectoryFederationServices20.FederationServerProxyWebsites
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.ActiveDirectoryFederationServices20.TwoStateScriptMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
AD FS application pool Is Not Running On The Federation Server Proxy
The AD FS application pool is not running on IIS on the federation server proxy.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.ActiveDirectoryFederationServices20.FederationServerProxyWebsitesIISMonitor" Accessibility="Public" Enabled="true" Target="Microsoft.ActiveDirectoryFederationServices20.FederationServerProxyWebsites" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.ActiveDirectoryFederationServices20.TwoStateScriptMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.ActiveDirectoryFederationServices20.FederationServerProxyWebsitesIISMonitor_AlertMessageResourceID">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<PowerShellPath>%windir%\system32\windowspowershell\v1.0\powershell.exe</PowerShellPath>
<ScriptName>FederationServerProxyWebsitesIISCheck.ps1</ScriptName>
<ScriptBody><Script>
$scomapi = new-object -comObject "MOM.ScriptAPI"
$scomapi.LogScriptEvent("ActiveDirectoryFederationServices", 500, 4, "IIS server check PowerShell monitoring script")

$serviceWMIObject = (get-wmiobject -query "select * from win32_service where name='w3svc'")
$script:serviceOK = $false
$script:exceptionMessage = ""
#try
&amp;{

if ( $serviceWMIObject.Started )
{
$appPoolState = Get-WmiObject -namespace root/MicrosoftIISV2 -Class IIsApplicationPoolSetting | Where-Object {$_.Name -eq "W3SVC/APPPOOLS/ADFSAppPool"} | select-object AppPoolState
if ( $appPoolState.AppPoolState -eq 2 )
{
$script:serviceOK = $true
}
}
}
trap [System.Exception]
{
$script:serviceOK = $false
$script:exceptionMessage = $_.Exception.Message
continue
}

$scompb = $scomapi.CreatePropertyBag()
$scompb.AddValue("ServiceOK", $script:serviceOK )
$scompb.AddValue("ErrorMessage", $script:exceptionMessage )
$scomapi.AddItem($scompb)
$scomapi.ReturnItems() </Script></ScriptBody>
<IntervalSeconds>300</IntervalSeconds>
<TimeoutSeconds>180</TimeoutSeconds>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ServiceOK']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">false</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ServiceOK']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">true</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
</Configuration>
</UnitMonitor>