I am trying to script the change of ScriptMaps variable on some IIS Websites (IIS 6 on Win2003). I have been using ADSI to get the value but I cannot find a way to Set (Put) the value.
([ADSI]"IIS://$computer/$name").Properties["ScriptMaps"]
So i tried this:
PS > $scriptmaps = ([ADSI]"IIS://$computer/$name").Properties["ScriptMaps"]
PS > $scriptmaps = $scriptmaps + ".css,C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG"
PS > ([ADSI]"IIS://$computer/$name").Put("ScriptMaps", $scriptmaps)
But it does not work, the new value for .css has not been added. Any ideas?
Thanks,
Matt