无法识别阻止 IIS 配置更改的锁定部分
Can't identify which section is locked that is prevent IIS config change
当运行下面的命令告诉我它被锁定在某个地方但我不知道在哪里:
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 : This configuration section cannot be used at this path. This happens when the section
is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
At 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
我确认 httplogging 和 system.applicationHost/log 已在服务器级别解锁。还有什么可以锁定来阻止这种情况?
PSPath 错误,应该是“-PSPath 'MACHINE/WEBROOT/APPHOST”。那个错误消息真的很愚蠢而且没有帮助。
这个有效:
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"
}
当运行下面的命令告诉我它被锁定在某个地方但我不知道在哪里:
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 : This configuration section cannot be used at this path. This happens when the section
is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
At 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
我确认 httplogging 和 system.applicationHost/log 已在服务器级别解锁。还有什么可以锁定来阻止这种情况?
PSPath 错误,应该是“-PSPath 'MACHINE/WEBROOT/APPHOST”。那个错误消息真的很愚蠢而且没有帮助。
这个有效:
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"
}