Wednesday, December 19, 2012

To see a list of all application pools in IIS 7.x, run the following command in an elavated priviliges command prompt:

%windir%\system32\inetsrv\appcmd.exe list wp


For IIS 6.x or lesser the corresponding command is iisapp. The list shows application pool number and its name.

To recycle an application pool, use the following syntax:

appcmd recycle apppool /apppool.name: string


Powershell needs to refer to correct assembly to access details of application pools like so:

[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")

$sm = New-Object Microsoft.Web.Administration.ServerManager

foreach($site in $sm.Sites)
{
    $root = $site.Applications | where { $_.Path -eq "/" }
    Write-Output ("Site: " + $site.Name + " | Pool: " + $root.ApplicationPoolName)
}


No comments:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...