Get IIS AppPool Info

Here is a simple PowerShell function to check the app pool status on remote servers. It make use of Microsoft.Web.Administration Namespace instead of WebAdministration snap-in. Please let me know your feed back.


List the app pools and it' state remotely.

Get the app pools and it's status remotely making use of
.NET Microsoft.Web.Administration namespace.

.PARAMETER ComputerName
Provide the name or IP address of a remote computer or a list
of computer names separated by a comma.

Get-AppPool -Computer comp1,comp2

Function Get-AppPool(){
[parameter(mandatory = $True, Position = 1)]

foreach ($Server in $ComputerName){
$sm = [Microsoft.Web.Administration.ServerManager]::OpenRemote($Server)
$appPools = $sm.ApplicationPools
$appPools | Select-Object name,state | Format-Table -AutoSize


Popular posts from this blog

Check SQL Server Database Status

PowerShell and Azure Resource Graph

Static Code Analysis: Some Tools