Create a gist now

Instantly share code, notes, and snippets.

managing an IIS AppPool from Ruby
require 'win32ole'
# Connect to the WMI WebAdministration namespace.
web_admin = WIN32OLE.connect("winmgmts:root\\WebAdministration")
app_pool = web_admin.get("ApplicationPool.Name='DefaultAppPool'")
require 'win32/registry'
keyname = "SOFTWARE\\Microsoft\\InetStp\\Components"
registry =
tools_installed = registry["ManagementScriptingTools"] == 1
puts "IIS Management Scripts and Tools installed? #{tools_installed}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment