« Previous Next »

Thread: WMI Script for adding a daily recycle time to application Pool

Last post 01-13-2009 9:09 AM by jabaran. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 01-12-2009, 11:26 AM

    • jabaran
    • Not Ranked
    • Joined on 07-18-2006, 10:53 PM
    • Posts 3

    WMI Script for adding a daily recycle time to application Pool

    I've been unable to figure out how to write a WMI script to add a daily recycle of the application pool daily at 2am.  Any suggesions?

  • 01-12-2009, 1:59 PM In reply to

    Re: WMI Script for adding a daily recycle time to application Pool

    When using IIS 7 you could also make use of Powershell provider ... that could be much easier ... The only command you need to know is Restart-WebItem

    Restart-WebItem DefaultAppPool

    Provided you have the IIS snap-in running on the machine....

    Regards,
    MA Khan
    http://www.iisworkstation.com

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 01-12-2009, 4:54 PM In reply to

    • jabaran
    • Not Ranked
    • Joined on 07-18-2006, 10:53 PM
    • Posts 3

    Re: WMI Script for adding a daily recycle time to application Pool

     Unfortunately that will not work for me because I'm doing this as part of an install, and I need to be able to apply their restart cycles during the install.  I've managed to create everything I've needed to except this.

  • 01-12-2009, 11:17 PM In reply to

    Re: WMI Script for adding a daily recycle time to application Pool

    appcmd recycle "AppPoolName".  During the install, run a script or command that executes either Powershell or appcmd.  That should work or

    http://learn.iis.net/page.aspx/163/managing-applications-and-application-pools-on-iis-7-with-wmi/

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 01-13-2009, 8:15 AM In reply to

    Re: WMI Script for adding a daily recycle time to application Pool

    why not schedule it at the app pool property page?

    Cheers,
    Bernard Cheah
  • 01-13-2009, 9:09 AM In reply to

    • jabaran
    • Not Ranked
    • Joined on 07-18-2006, 10:53 PM
    • Posts 3

    Re: WMI Script for adding a daily recycle time to application Pool

    Our customers don't always have an IT staff and I don't trust our installation teams to remember to always schedule it. Oh, and management is requiring it :-)

Page 1 of 1 (6 items)
Microsoft Communities