Skip to content

Instantly share code, notes, and snippets.

@davewilson
Created June 24, 2014 03:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davewilson/89cdbe3fc258649d7454 to your computer and use it in GitHub Desktop.
Save davewilson/89cdbe3fc258649d7454 to your computer and use it in GitHub Desktop.
Function Get-EventLogAudit {
param (
$whichLog,
[datetime]$start,
[datetime]$end
)
$totalDays = ($end - $start).Days
$randomDay = $start.AddDays((Get-Random $totalDays))
$randomDayHour = $randomDay.AddHours((Get-Random 24))
Get-EventLog -LogName $whichLog -After $randomDayHour -Before $randomDayHour.AddHours(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment