shilpa Posted May 11, 2016 Posted May 11, 2016 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 JLogan3o13 Posted May 11, 2016 Moderators Posted May 11, 2016 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 shilpa 1 "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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now