The Get-IISAppPool cmdlet helps to access and configure Internet Information Services (IIS) application pools. This cmdlet is available within the IISAdministration PowerShell module. It enables users to retrieve information, such as application pool name, .Net framework version, runtime version, state, and recycling settings of an existing IIS application pool.

This cmdlet examines the applicationHost.config configuration file in the server’s system drive.

What is the difference between IISAdministration VS WebAdministration PowerShell Module

IISAdministration is a new and simplified PowerShell Cmdlet module released by the IIS team alongside the existing WebAdministration Cmdlets. It was designed to scale better in scripts that take a long time to run, works better with PowerShell Pipeline, and allows users to get a direct reference to an instance of Microsoft.Web.Administration.ServerManager object.

The first release was for Windows 10, and the finished and polished product was targeted for Windows Server 2016. Some main points about IISAdministration VS WebAdministration are

  • It’s compatible with IIS 10.0 and supports installing it via the PowerShell gallery for earlier versions.
  • The module provides functionality for managing IIS through PowerShell pipelines.
  • The IISAdministration cmdlets are simpler and allow broader access to the IIS component.

Usage for Get-IISAppPool

The cmdlet supports several parameters, which gives you flexibility in retrieving and managing the IIS application pool configuration settings. For example, you can use the Parameters Name or State to get application pools. You can also use the pipeline feature of Windows PowerShell to easily apply changes or modifications to all application pools on the server in just one pass.

Before starting, make sure that the PowerShell console start as Administrator, otherwise you will get an unexpected errors and results

I notice that some changes will not be reflected unless closing PowerShell console and start it again

Below are some examples that will help you understand the usage and purpose of Get-IISAppPool:

  • To get a list of all the application pools on the IIS Web Server, use the command:

PS:> Get-IISAppPool
Get-IISAppPool
  • To get the current status of a specific application pool, use the command:
PS:> Get-IISAppPool -name DefaultAppPool
 Get-IISAppPool defaultpool
  • To start an application pool, use the command:

The .Start is a method in the Get-IISAppPool, learn more about PowerShell object Properties and Methods in What is PowerShell and Why Use it

PS:> (Get-IISAppPool -name DefaultAppPool).start()

Started

To check the version of a specific application pool, use the command:

PS:> (Get-IISAppPool -Name MyApplicationPool).ManagedRuntimeVersion

v4.0

Object Property Returned From Get-IISAppPool

Get-IISAppPool is a powerful cmdlet with many useful properties for managing IIS applications. Here is a list of properties that can be returned from this cmdlet:

  • Attributes: The attributes of the application pool.
  • AutoStart: Boolean value that indicates whether the application pool will be automatically started.
  • ChildElements: An array of XML elements that contain information about the application pool.
  • Cpu: Contains CPU-related settings such as maximum usage, reset interval, etc.
  • ElementTagName: The name of the XML element that contains information about the application pool.
  • Enable32BitAppOnWin64: Boolean value indicates whether 32-bit applications are enabled on the 64-bit operating system.
  • EnableEmulationOnWinArm64: Boolean value that indicates whether emulation is enabled for ARM64 Windows versions.
  • Failure: Contains information about how the application pool handle failure such as HTTPLevel failure…
  • IsLocallyStored: Boolean value that indicates whether the application pool is stored locally.
  • ManagedPipelineMode: Indicates whether IIS is running in integrated or classic pipeline mode.
  • ManagedRuntimeVersion: The version of the .NET runtime used by the application pool.
  • Methods: An array of XML elements that contain methods for managing the application pool, such as Start, Stop, and Recycle.
  • Name: The name of the application pool.
  • ProcessModel: Contains settings configuring the process model, such as identity settings, username, and application pool password.
  • QueueLength: The number of requests that can be queued before reaching the limit.
  • RawAttributes: The raw attributes collection for the application pool.
  • Recycling: Contains settings that configure application pool recycling.
  • Schema: The XML element schema containing information about the application pool.
  • StartMode: Indicates whether the application pool should be started automatically or manually.
  • State: Indicates whether the application pool is running.
  • WorkerProcesses: Contains settings that configure the worker process list.

For additional information, go to https://go.microsoft.com/fwlink/?linkid=861395.

5/5 - (2 votes)