Jump to content

Recommended Posts

Posted

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,

 

  • Moderators
Posted

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

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...