powershell - Can't identify which section is locked that is prevent IIS config change -


when running command below tells me locked somewhere don't know where:

ps c:\windows\system32\inetsrv> set-webconfigurationproperty -pspath 'machine/webroot/apphost/mysite' -filter "system. applicationhost/sites/site[@name='mysite']" -name "logfile" -value @{ >>  directory = "c:/inetpub/mysite/logs" >>  period="maxsize" >>  truncatesize="52428800" >>  localtimerollover="true" >> } >> set-webconfigurationproperty : configuration section cannot used @ path. happens when section locked @ parent level. locking either default (overridemodedefault="deny"), or set explicitly location tag overridemode="deny" or legacy allowoverride="false". @ line:1 char:1 + set-webconfigurationproperty -pspath 'machine/webroot/apphost/mysite' -filter  ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [set-webconfigurationproperty], fileloadexception     + fullyqualifiederrorid : system.io.fileloadexception,microsoft.iis.powershell.provider.setconfigurationpropertycommand 

i confirmed httplogging , system.applicationhost/log unlocked @ server level. else locked preventing this?

pspath wrong, should have been "-pspath 'machine/webroot/apphost". error message stupid , unhelpful.

this works:

set-webconfigurationproperty -pspath 'machine/webroot/apphost' -filter "system. applicationhost/sites/site[@name='mysite']" -name "logfile" -value @{  directory = "c:/inetpub/mysite/logs"  period="maxsize"  truncatesize="52428800"  localtimerollover="true" } 

Comments