Get app-pool and website status on remote servers

Hi there,

i have list of windows servers(2000/2003/2008) in Column A, i need to get the status of App-pool and website running/stopped on them in same excel.

August 2nd, 2015 10:46am

Please try this method:

$aPool = gwmi -Namespace "root\MicrosoftIISv2" -class "IIsApplicationPoolSetting" -filter "Name='W3SVC/APPPOOLS/DefaultAppPool'"

$aPool.AppPoolState

AppPoolState will return 1=starting, 2=started, 3=stopping, 4=stopped

If you are using IIS 7.0+ you can also take use of the WebAdministration namespace aswell:

$aPool = gwmi -Namespace root\webAdministration -class ApplicationPool -filter "Name='DefaultAppPool'" | % { $_.GetState() }

$aPool.ReturnValue


ReturnValue will return 1=started, 2=starting, 3 = stopped, 4=stopping

  • Proposed as answer by guGuuuMy 35 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 2:51am

Please try this method:

$aPool = gwmi -Namespace "root\MicrosoftIISv2" -class "IIsApplicationPoolSetting" -filter "Name='W3SVC/APPPOOLS/DefaultAppPool'"

$aPool.AppPoolState

AppPoolState will return 1=starting, 2=started, 3=stopping, 4=stopped

If you are using IIS 7.0+ you can also take use of the WebAdministration namespace aswell:

$aPool = gwmi -Namespace root\webAdministration -class ApplicationPool -filter "Name='DefaultAppPool'" | % { $_.GetState() }

$aPool.ReturnValue


ReturnValue will return 1=started, 2=starting, 3 = stopped, 4=stopping

September 8th, 2015 6:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics