Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

managing an IIS AppPool from Ruby

View app_pool.rb
1 2 3 4 5 6 7 8 9 10
require 'win32ole'
 
# Connect to the WMI WebAdministration namespace.
web_admin = WIN32OLE.connect("winmgmts:root\\WebAdministration")
app_pool = web_admin.get("ApplicationPool.Name='DefaultAppPool'")
 
app_pool.stop
app_pool.start
 
app_pool.recycle
View app_pool.rb
1 2 3 4 5 6 7 8
require 'win32/registry'
 
keyname = "SOFTWARE\\Microsoft\\InetStp\\Components"
registry = Win32::Registry::HKEY_LOCAL_MACHINE.open(keyname)
 
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
Something went wrong with that request. Please try again.