Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

iis 6 app pool recycle api

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  How many Wildcard Certificates required for this ..  
Author Message
jason

External


Since: Mar 14, 2006
Posts: 9



(Msg. 1) Posted: Mon Mar 12, 2007 12:30 pm
Post subject: iis 6 app pool recycle api
Archived from groups: microsoft>public>inetserver>iis (more info?)

is there a way to recycle an application pool programtically through an api
or some other way besides using the inetmgr gui?

thanks
-jason

 >> Stay informed about: iis 6 app pool recycle api 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 175



(Msg. 2) Posted: Tue Mar 13, 2007 4:11 am
Post subject: Re: iis 6 app pool recycle api [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

If Windows 2003 SP1 has been installed, we now add a new /r switch to
iisapp.vbs which can be used to recycle app pools:

cscript iisapp.vbs /a DefaultAppPool /r

You can refer to the source of iisapp.vbs for the detail.

Below is sample script based on WMI. Simply name it to IISRECYCLE.VBS to
use. Please note the AppPoolName argument need to be case-sensitive.

' <----------------- code begin ----------------->

'By Default Recycle All App Pools

bRecycleAll = 1

If Wscript.arguments.count = 0 Then

Wscript.Echo "Syntax: cscript iisrecycle.vbs server
[AppPoolName]"

WScript.Echo "Example: cscript iisrecycle.vbs localhost
DefaultAppPool"

WScript.Quit (0)

Else

strServer = WScript.arguments(0)

If WScript.arguments.count > 1 Then

strAppPoolName = WScript.arguments(1)

bRecycleAll = 0

End If

End If

set Locator = CreateObject("WbemScripting.SWbemLocator")

set Service = locator.connectserver(strServer,"root/MicrosoftIISv2")

service.Security_.AuthenticationLevel = 6

set APCollection = Service.InstancesOf("IISApplicationPool")

If bRecycleAll = 1 Then

For each APInstance in APCollection

APInstance.Recycle

Next

Else

For each APInstance in APCollection

If UCase(ApInstance.Name) = UCase("W3SVC/AppPools/"
& strAppPoolName) Then

APInstance.Recycle

End If

Next

End If

' <----------------- code end ----------------->


Have a good day.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 >> Stay informed about: iis 6 app pool recycle api 
Back to top
Login to vote
jason

External


Since: Mar 14, 2006
Posts: 9



(Msg. 3) Posted: Tue Mar 13, 2007 6:56 am
Post subject: Re: iis 6 app pool recycle api [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thanks!

""WenJun Zhang[msft]"" wrote:

> Hi,
>
> If Windows 2003 SP1 has been installed, we now add a new /r switch to
> iisapp.vbs which can be used to recycle app pools:
>
> cscript iisapp.vbs /a DefaultAppPool /r
>
> You can refer to the source of iisapp.vbs for the detail.
>
> Below is sample script based on WMI. Simply name it to IISRECYCLE.VBS to
> use. Please note the AppPoolName argument need to be case-sensitive.
>
> ' <----------------- code begin ----------------->
>
> 'By Default Recycle All App Pools
>
> bRecycleAll = 1
>
> If Wscript.arguments.count = 0 Then
>
> Wscript.Echo "Syntax: cscript iisrecycle.vbs server
> [AppPoolName]"
>
> WScript.Echo "Example: cscript iisrecycle.vbs localhost
> DefaultAppPool"
>
> WScript.Quit (0)
>
> Else
>
> strServer = WScript.arguments(0)
>
> If WScript.arguments.count > 1 Then
>
> strAppPoolName = WScript.arguments(1)
>
> bRecycleAll = 0
>
> End If
>
> End If
>
> set Locator = CreateObject("WbemScripting.SWbemLocator")
>
> set Service = locator.connectserver(strServer,"root/MicrosoftIISv2")
>
> service.Security_.AuthenticationLevel = 6
>
> set APCollection = Service.InstancesOf("IISApplicationPool")
>
> If bRecycleAll = 1 Then
>
> For each APInstance in APCollection
>
> APInstance.Recycle
>
> Next
>
> Else
>
> For each APInstance in APCollection
>
> If UCase(ApInstance.Name) = UCase("W3SVC/AppPools/"
> & strAppPoolName) Then
>
> APInstance.Recycle
>
> End If
>
> Next
>
> End If
>
> ' <----------------- code end ----------------->
>
>
> Have a good day.
>
> Sincerely,
>
> WenJun Zhang
>
> Microsoft Online Community Support
>
> ==================================================
>
> Get notification to my posts through email? Please refer to:
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at:
>
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
 >> Stay informed about: iis 6 app pool recycle api 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 175



(Msg. 4) Posted: Wed Mar 14, 2007 2:14 am
Post subject: Re: iis 6 app pool recycle api [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You are welcome Jason.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 >> Stay informed about: iis 6 app pool recycle api 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
recycle app pool remotely - Hi; Is there a way to recycle an application pool on a remote machine running IIS6 using some kind of a command line utility? I know that I could use iisapp.vbs but as far as I know it only works localy. Any sugestions? Thanks Paul Kus..

Script to recycle IIS 6 application pool - Hello, I've found the script iisweb.vbs that allows me to stop and start an IIS application but I need one that can recycle an application pool. Anyone have one? Thanks, Greg

recycle app pool via command line - Is there a way to recycle an app pool on the command line?

IIS crash on application pool recycle or shutdown - On a Windows Server 2003 machine running IIS6.0 + PHP 5.1.3-dev running as isapi. Everytime the application pool recycles or is shutting down, the w3wp.exe process that is shutting down crashes. The w3wp.exe process that is being started, will start..

Application pool recycle - identity problem - Hi. I have little code to recycle application pool via web: DirectoryEntry apppool = new DirectoryEntry("IIS://localhost/w3svc/AppPools/MyPool"); apppool.Invoke("Recycle"); Now, when this script is run using application pool with i...
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]