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:

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...