How do I enumerate IIS websites using Powershell and find the app pool for each?

前端 未结 3 2183
死守一世寂寞
死守一世寂寞 2021-02-19 20:02

I can search for websites using:

Get-WmiObject -Namespace \"root\\WebAdministration\" -Class Site -Authentication PacketPrivacy -ComputerName $servers

3条回答
  •  不要未来只要你来
    2021-02-19 20:42

    Here's another option if you do not want to use the IIS:\ path.

    $site = Get-IISSite -Name 'my-site'
    $appPool = Get-IISAppPool -Name $site.Applications[0].ApplicationPoolName
    

提交回复
热议问题