Using Powershell to Access IIS Logs?

I know that you can use powershell to do things like registry with drive letter. PowerShell has other objects to handle other objects this way. Does anyone know of any cmd permission to access IIS logs this way?

+5
source share
2 answers
+5
source

Will a quick and dirty script work? The third header line of the W3c log file (saved by default IIS) has the line #Header ... Save the following as 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('#')) }
+2
source

All Articles