Powershell – how to operate On List of IIS Application Pools On Remote Server Using Powershell

iispoolpowershell

I am trying to build powershell program which would:

  1. connect to the remote server
  2. Show number of active IIS app pools on the active server
  3. based on the selection (1,2,3,4,….n etc) it would reset app pool

Can you please give me some tips?

Best Solution

Give this a try:

[Reflection.Assembly]::LoadWithPartialName('Microsoft.Web.Administration')
$sm = [Microsoft.Web.Administration.ServerManager]::OpenRemote('server1')
$sm.ApplicationPools['AppPoolName'].Recycle()
Related Question