Skip to content

Instantly share code, notes, and snippets.

@sri-prasanna
Last active December 19, 2015 09:59
Show Gist options
  • Save sri-prasanna/5936616 to your computer and use it in GitHub Desktop.
Save sri-prasanna/5936616 to your computer and use it in GitHub Desktop.
A collection of powershell scripts that I create..
#script to list all eventlog entries with a specific text in the description
$regex_to_match=".*RoutingExtensions.*"
Get-EventLog -LogName "Application" | Where-Object {$_.Message -match $regex_to_match} | format-list -Property Source,EntryType,Message,TimeWritten
#filter eventlog entries based on date and regular expression
$regex_to_match=".*DfpLibrary.*"
$dateVal = (get-date 2013-07-01)
Get-EventLog -LogName "Application" | Where-Object {$_.Message -match $regex_to_match -and $_.TimeWritten -gt $dateVal} | format-list -Property Source,EntryType,Message,TimeWritten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment