3

we using the below command to get the list of the site added in is:

%systemroot%\system32\inetsrv\AppCmd.exe list sites

but the above command can not take a list of app pools related to the site.

I want a list of app pools. if a single command to viewing list of site and related app pool, really good.

User12
  • 69
  • 1
  • 7
  • Do you get any error running the command? E.g. something about _insufficient permissions_? Please [edit] the question and share full traceback (sanitized if necessary). – JosefZ May 16 '21 at 15:17
  • If you study some basic IIS concepts, then you can answer your own questions. https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis Since application pools are associated with only applications, it is impossible to achieve what you wanted when querying sites. Similarly, physical paths are associated only with virtual directories. – Lex Li May 16 '21 at 16:09

2 Answers2

4

below command, get the list of the application pools:

%systemroot%\system32\inetsrv\AppCmd.exe list apppool
User12
  • 69
  • 1
  • 7
1

You can also do in powershell via Get-IISAppPool in the IISAdministration Module like this:

Import-Module IISAdministration

Get-IISAppPool
KyleMit
  • 488
  • 4
  • 9
  • 21