如何使用PowerShell检索IIS日志记录,日志事件目标设置

时间:2020-09-04 14:45:04

标签: powershell iis server scripting windows-server-2012-r2

使用PowerShell,我一直在寻找一个命令来检索选择了哪个设置单选按钮选项或存储该设置的IIS配置文件。

我能够检索其他“日志记录”选项,但不能检索以上

任何帮助将不胜感激。

谢谢。

1 个答案:

答案 0 :(得分:0)

Get-Website包含您需要的信息:

$Site = Get-Website -Name "my web site"
$Site.logfile.directory # log file location
$Site.logfile.logTargetW3C # w3c destinations
$Site.Logfile.logFormat # log format

要验证目的地,您将需要检查logTargetW3C属性的字符串值。值为FileFile,ETWETW