VB Script to see apppool status.

Author Message
shajilcv

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 6/23/2011
  • Status: offline
VB Script to see apppool status. Thursday, June 23, 2011 10:49 PM (permalink)
0
i am running below script to get the app pool status. i am getting below error. can anyone help me on this
 
Line:6
Char:1
Error : Invalid namespace.
 
code
------------------------------------------------------------------------------------------------------------------
StrServer = "server1"
Set locatorObj = CreateObject("WbemScripting.SWbemLocator") locatorObj.Security_.AuthenticationLevel = WbemAuthenticationLevelPktPrivacy   Set ProviderObj = locatorObj.ConnectServer(strServer, "domain\username")   strQuery = "Select * from IIsApplicationPoolSetting"   For Each Item In ProviderObj.ExecQuery(strQuery)   AppName = Replace(Item.Name, "W3SVC/AppPools/", "")         Select Case Item.AppPoolState     Case 1       State = "Starting"
Case 2       State = "Running"
Case 3       State = "Stopping"
Case 4       State = "Stopped"
Case else       State = "unknown"
End Select 

Next
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9