Install-IisAppPool

Creates a new app pool.

Syntax

Install-IisAppPool -Name <String> [-ManagedRuntimeVersion <String>] [-IdleTimeout <Int32>] [-ClassicPipelineMode] [-Enable32BitApps] [-ServiceAccount <String>] [<CommonParameters>]
 Install-IisAppPool -Name <String> [-ManagedRuntimeVersion <String>] [-IdleTimeout <Int32>] [-ClassicPipelineMode] [-Enable32BitApps] [-ServiceAccount <String>] -UserName <String> -Password <Object> [<CommonParameters>]

Description

By default, creates a 64-bit app pool running as the ApplicationPoolIdentity service account under .NET v4.0 with an integrated pipeline.

You can control which version of .NET is used to run an app pool with the ManagedRuntimeVersion parameter: versions v1.0, v1.1, v2.0, and v4.0 are supported.

To run an application pool using the classic pipeline mode, set the ClassicPipelineMode switch.

To run an app pool using the 32-bit version of the .NET framework, set the Enable32BitApps switch.

An app pool can run as several built-in service accounts, by passing one of them as the value of the ServiceAccount parameter: NetworkService, LocalService, or LocalSystem The default is ApplicationPoolIdentity, which causes IIS to create and use a custom local account with the name of the app pool. See Application Pool Identities for more information.

To run the app pool as a specific user, pass the username and password for the account to the Username and Password parameters, respectively. This user will be granted the SeBatchLogonRight privilege.

If an existing app pool exists with name Name, it's settings are modified. The app pool isn't deleted. (You can't delete an app pool if there are any websites using it, that's why.)

By default, this function will create an application pool running the latest version of .NET, with an integrated pipeline, as the NetworkService account.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String The app pool's name. true false
ManagedRuntimeVersion String The managed .NET runtime version to use. Default is 'v4.0'. Valid values are v1.0, v1.1, v2.0, or v4.0. false false v4.0
IdleTimeout Int32 Idle Timeout value in minutes. Default is 0. false false 0
ClassicPipelineMode SwitchParameter Use the classic pipeline mode, i.e. don't use an integrated pipeline. false false False
Enable32BitApps SwitchParameter Enable 32-bit applications. false false False
ServiceAccount String Run the app pool under the given local service account. Valid values are NetworkService, LocalService, and LocalSystem. The default is ApplicationPoolIdentity, which causes IIS to create a custom local user account for the app pool's identity. The default is ApplicationPoolIdentity. false false
UserName String Runs the app pool under a specific user account. true false
Password Object The password for the user account. Can be a string or a SecureString. true false

EXAMPLE 1

Install-IisAppPool -Name Cyberdyne -ServiceAccount NetworkService

Creates a new Cyberdyne application pool, running as NetworkService, using .NET 4.0 and an integrated pipeline. If the Cyberdyne app pool already exists, it is modified to run as NetworkService, to use .NET 4.0 and to use an integrated pipeline.

EXAMPLE 2

Install-IisAppPool -Name Cyberdyne -ServiceAccount NetworkService -Enable32BitApps -ClassicPipelineMode

Creates or sets the Cyberdyne app pool to run as NetworkService, in 32-bit mode (i.e. 32-bit applications are enabled), using the classic IIS request pipeline.

EXAMPLE 3

Install-IisAppPool -Name Cyberdyne -Username 'PEANUTS\charliebrown' -Password '5noopyrulez'

Creates or sets the Cyberdyne app pool to run as the PEANUTS\charliebrown domain account, under .NET 4.0, with an integrated pipeline.