WWW service encountered an error when it tried to secure the handle of the application pool

Microsoft.Windows.InternetInformationServices.2008.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool (Rule)

Knowledge Base article:

Summary

Web sites and Web applications depend on the availability of Internet Information Services (IIS) application pools. IIS application pools in turn depend on the Windows Process Activation Service (WAS). If WAS is not running or errors occur during the startup or shutdown of an application pool, Web sites and Web applications may not be available.

Resolutions

Set the application pool identity and restart the application pool

The application pool identity must be set to a valid account for the application pool to function. There are two types of Identity for the application pools: Built-in and Custom. The built-in accounts are NetworkService, LocalService, and LocalSystem. The default (recommended) is NetworkService. If you set the application pool identity to a custom account, you will have to ensure that the user credentials are valid and that the user is a member of the IIS_USRS group. The following procedures describe how to set the application pool identity and then restart the application pool.

To set the application pool identity:

To add a specific user (custom account) to the IIS_USRS group:

Note: After you add a user to the IIS_USRS group, the Web services must be stopped and restarted for the new logon rights to take effect. This will stop all Web traffic to the server.

If you did not add an identity to the IIS_USRS group, continue to the steps to stop and restart the application pool.

To stop and restart the Web services:

To stop and restart the application pool:

You can also restart the application pool using the link below:

Recycle Application Pool

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.2008.ApplicationPool
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
WWW service encountered an error when it tried to secure the handle of the application pool
{0}

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.Server.IIS.2008.WarningAndErrorEventProvider Default
Filter ConditionDetection Microsoft.Windows.InternetInformationServices.2008.ApplicationPool.EventFilter Default
WA WriteAction Microsoft.Windows.Server.IIS.2008.GenerateAlertAction.SuppressedByDescription Default

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.2008.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool" Enabled="onEssentialMonitoring" Target="Microsoft.Windows.InternetInformationServices.2008.ApplicationPool" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.Windows.Server.IIS.2008.WarningAndErrorEventProvider">
<LogName>System</LogName>
</DataSource>
</DataSources>
<ConditionDetection ID="Filter" TypeID="Microsoft.Windows.InternetInformationServices.2008.ApplicationPool.EventFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>1026</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-IIS-W3SVC</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.2008.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.2008.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>