Skip to content

Commit

Permalink
Update Block-WebOffenders.ps1
Browse files Browse the repository at this point in the history
Small update to analyze currently opened logs.
  • Loading branch information
gtworek authored Nov 13, 2024
1 parent cf67b24 commit 10c124e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Misc/Block-WebOffenders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ $fieldNumCIP = -1
$fileName = "C:\inetpub\logs\LogFiles\W3SVC2\u_ex231109.log"

$ips = @{}
$Reader = New-Object System.IO.StreamReader($fileName)

$fileStream = [System.IO.FileStream]::new($fileName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite)
$Reader = [System.IO.StreamReader]::new($fileStream)
while($Line = $Reader.ReadLine())
{
if ($Line.StartsWith('#Fields: '))
Expand Down

0 comments on commit 10c124e

Please sign in to comment.