Skip to content

Instantly share code, notes, and snippets.

@nshores
Last active July 30, 2019 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshores/7e7c58913ec53b11160632b0bcd0753c to your computer and use it in GitHub Desktop.
Save nshores/7e7c58913ec53b11160632b0bcd0753c to your computer and use it in GitHub Desktop.
failed_windows_logins.ps1
$a = Get-EventLog -LogName 'Security' -InstanceId 4776 | select ReplacementStrings
$array = @()
foreach ($b in $a) {
$array += $($b[0].ReplacementStrings)[1]
}
Write-Output $array
Write-Output "Final Count"$array.Count
$array | out-file fail.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment