使用Powershell访问IIS日志?

时间:2008-09-22 16:42:24

标签: iis logging powershell shell

我知道你可以使用powershell来使注册表成为驱动器号。在PowerShell中还有其他对象以这种方式处理其他对象。有没有人知道任何cmd-lets以这种方式访问​​IIS日志?

2 个答案:

答案 0 :(得分:5)

查看此博文:

IIS 7.0 Powershell Support

答案 1 :(得分:2)

快速而脏的脚本会起作用吗? W3c日志文件头的第三行(默认情况下由IIS保存)具有#Header行...将以下内容保存为Import-W3CLog.ps1

param ($logfile)
import-csv -Delimiter " " -Header "date","time","s-ip","cs-method","cs-uri-stem","cs-uri-query","s-port","cs-username","c-ip","csUser-Agent","sc-status","sc-substatus","sc-win32-status","time-taken" -path $logfile | where { !($_.Date.StartsWith('#')) }
相关问题