12.20. Configuring Application Pool Identities

Problem

You want to configure the identity of an application pool.

Solution

Using a graphical user interface

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the server node in the console tree and select Application Pools.

  3. Right-click on the target application pool and select Properties.

  4. Select to the Identity tab.

  5. Select either one of the three predefined identities or a custom user account and click OK.

Using a command-line interface

The following two commands assign a custom user account for an application pool identity and set the password for the account:

> cscript %systemroot%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/
<AppPoolName>/WAMUserName <Username>
> cscript %systemroot%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/
<AppPoolName>/WAMUserPass <Password>

Replace <AppPoolName> with the name of the target application pool, <Username> with the name, and <Password> with the user's password.

Using VBScript

' This code configures an app pool identity.
' ------ SCRIPT CONFIGURATION ------
strComputer = "<ServerName>"
strAppPoolName = "<AppPoolName>"
strUser   = "<Username>"  ' e.g., RALLENCORP\myiisuser
strPasswd = "<Password>" ' ------ END CONFIGURATION --------- set objAppPool = GetObject("IIS://" & strComputer & "/w3svc/AppPools/" & _ strAppPoolName) objAppPool.AppPoolIdentityType = 3 objAppPool.WAMUserName = strUser objAppPool.WAMUserPass = strPasswd objAppPool.SetInfo( ) WScript.Echo "App Pool ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.