« Previous Next »

Answered Thread: Script Content Expiration Settings in IIS6

Last post 08-28-2007 7:10 PM by ksingla. 1 replies.

 

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 08-28-2007, 6:38 AM

    Script Content Expiration Settings in IIS6

     Hi,

    can someone show me an example how to script the content expiration settings for an virtual directory?

     

    Thank you very much

     

  • 08-28-2007, 7:10 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 981

    Answered Re: Script Content Expiration Settings in IIS6

    Here is a sample printing properties for a vdir. You can filter on vdir name and then set the value.

    Set objWMIService = GetObject("winmgmts://./root/microsoftiisv2")
    Set nodes = objWMIService.InstancesOf("IISWebVirtualDirSetting")

    for each item in nodes
      WScript.Echo item.Properties_("Name").Value
      WScript.Echo item.Properties_("HttpExpires").Value
      'item.Properties_("HttpExpires").Value = ""
      'item.Put_
    next

    Kanwal

    Website/Blog - www.ksingla.net
    Twitter - http://twitter.com/kjsingla
Page 1 of 1 (2 items)