Sign in to follow this  
Followers 0
shilpa

How to Get AppPool name and status using WMI

2 posts in this topic

Hello,

 

I am new WMI. I want to take AppPool status and name of IIS server remotely. Can you please help me to get it?

I have used  GetObject() and ApplicationPool class with Impersonation. Still it is not working.

thanks,

 

Share this post


Link to post
Share on other sites



Hi, @shilpa something like this should get you the App Pool name:

Const $wbemFlagReturnImmediately = "&h10"
Const $wbemFlagForwardOnly = "&h20"

Local $sPC = "" ;Name of IIS Server
Local $oWMI = ObjGet("winmgmts:\\" & $sPC & "\root\WebAdministration")
Local $oItems = $oWMI.ExecQuery("SELECT * FROM ApplicationPool", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

    If IsObj($oItems) Then
        If $oItems.Count <> 0 Then
            For $sApp In $oItems
                ConsoleWrite("Application: " & $oItems.Name & @CRLF & "Start Mode: " & $oItems.StartMode & @CRLF)
            Next
        EndIf
    EndIf

 

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0