Created
          June 24, 2014 03:07 
        
      - 
      
 - 
        
Save davewilson/89cdbe3fc258649d7454 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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