Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Count non-comment lines from IIS logs for specific days (here 10-14th August 2020). Useful for checking load balancing
- ## Needs PowerShell 3.0 or above
- [string[]]$computers = 'Computer1','Computer2','Computer3'
- 10..14|%{ $day=$_.ToString('00'); invoke-command -compute $computers -scriptBlock { gc c:\inetpub\logs\LogFiles\W3SVC1\u_ex2008$using:day.log|sls -NotMatch '^#'|measure|select -Property @{n='day';e={$using:day}},@{n='Lines';e={$_.Count}} }|sort lines}|select * -exclude runspaceid|ft -auto
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement