Install-IisAppPool

Creates a new app pool.

Syntax

Install-IisAppPool -Name <String> [-ManagedRuntimeVersion <String>] [-IdleTimeout <Int32>] [-ClassicPipelineMode] [-Enable32BitApps] [-ServiceAccount <String>] [-PassThru] [<CommonParameters>]
Install-IisAppPool -Name <String> [-ManagedRuntimeVersion <String>] [-IdleTimeout <Int32>] [-ClassicPipelineMode] [-Enable32BitApps] [-ServiceAccount <String>] -UserName <String> -Password <Object> [-PassThru] [<CommonParameters>]
Install-IisAppPool -Name <String> [-ManagedRuntimeVersion <String>] [-IdleTimeout <Int32>] [-ClassicPipelineMode] [-Enable32BitApps] [-ServiceAccount <String>] -Credential <PSCredential> [-PassThru] [<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. Use an empty string if you're running .NET Core or to set the .NET framework version to No Managed Code.

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 credentials with the Credential parameter. (In some versions of Carbon, there is no Credential parameter, so use the UserName and Password parameters instead.) The 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.

Beginning with Carbon 2.0, the PassThru switch will cause this function to return a Microsoft.Web.Administration.ApplicationPool object for the created/updated application pool.

Beginning with Carbon 2.0.1, this function is available only if IIS is installed.

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. Use an empty string if you're using .NET Core or to set the .NET framework version to No Managed Code.

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

OBSOLETE. The UserName parameter will be removed in a future major version of Carbon. Use the Credential parameter instead.

true false
Password Object

OBSOLETE. The Password parameter will be removed in a future major version of Carbon. Use the Credential parameter instead.

true false
Credential PSCredential

The credential to use to run the app pool.

The Credential parameter is new in Carbon 2.0.

true false
PassThru SwitchParameter

Return an object representing the app pool.

false false False

Return Values

Microsoft.Web.Administration.ApplicationPool.

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 -Credential $charlieBrownCredential

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