IIS Stop and Start Application Pool

  • Follow


Hi, I'm not expert in Ruby....In my company we use a Ruby script to
deploy some services. No we need to implement the script stopping the
IIS application pool during deployment and then restart it....
Is there any way to do that in Ruby??? Someone here tells me that ruby
prepares coffe and cappuccino too....but...for IIS...I don't know how
to do it....
Any help will be very appreciated.
Thanks in advance

Giacomo
0
Reply IAK 11/22/2010 10:50:46 AM

[Note:  parts of this message were removed to make it a legal post.]

On Mon, Nov 22, 2010 at 4:55 AM, IAK <giviglie@gmail.com> wrote:

> Hi, I'm not expert in Ruby....In my company we use a Ruby script to
> deploy some services. No we need to implement the script stopping the
> IIS application pool during deployment and then restart it....
> Is there any way to do that in Ruby??? Someone here tells me that ruby
> prepares coffe and cappuccino too....but...for IIS...I don't know how
> to do it....
> Any help will be very appreciated.
> Thanks in advance
>
> Giacomo
>
>
Google led me to this page:
http://learn.iis.net/page.aspx/163/managing-applications-and-application-pools-on-iis-70-with-wmi/
 .

I modified the code snippets to ruby.

# ===  Stopping an Application Pool ===

require 'win32ole'

# Connect to the WMI WebAdministration namespace.
web_admin = WIN32OLE.connect("winmgmts:root\\WebAdministration")

# Specify the application pool.
app_pool = web_admin.get("ApplicationPool.Name='DefaultAppPool'")

# Stop the application pool.
app_pool.stop


# === Starting an Application Pool ===

require 'win32ole'

# Connect to the WMI WebAdministration namespace.
web_admin = WIN32OLE.connect("winmgmts:root\\WebAdministration")

# Specify the application pool.
app_pool = web_admin.get("ApplicationPool.Name='DefaultAppPool'")

# Start the application pool.
app_pool.start


# === Recycling an Application Pool ===

require 'win32ole'

web_admin = WIN32OLE.connect("winmgmts:root\\WebAdministration")
app_pool = web_admin.get("ApplicationPool.Name='DefaultAppPool'")

# Recycle the application pool.
app_pool.recycle

0
Reply Gordon 11/22/2010 4:23:23 PM


1 Replies
724 Views

(page loaded in 0.036 seconds)

Similiar Articles:













7/23/2012 9:40:08 AM


Reply: