views:

729

answers:

1

I know you can use powershell to make things like the registry a drive letter. There are other objects in powershell to treat other objects in this way. Does anyone know of any cmd-lets to access IIS logs in this manner?

+4  A: 

Check out this blog post:

IIS 7.0 Powershell Support

EBGreen
thanks. but these seem to drive managing the configuration of IIS through powershell, not reading/parsing the log files for requests. Did I miss something?
MikeJ
You probably didn't miss anything. Those are the only cmdlets I am aware of. Could you post more information about exactly what functionality you would like to see. The log files are just text files right? Is there something special that makes them different from parsing any other text file?
EBGreen
what I was looking to do was build scripts that would allow me to access all the vlaues in a log entry so that I could compute stats such as # of 404s, total bytes served etc.
MikeJ
In that case I'd say you are stuck writing your own parser. The good news is that it should be pretty trivial in Powershell.
EBGreen
i found logparser 2.2 which will work. albiet a bit clunky as I was looking to integrate it into code a bit better.
MikeJ
You can always use ODBC to connect to the text file and use SQL to query for ADO recordsets.
EBGreen