Skip to content

Filtering Security Logs

Featured Replies

We currently have a Powershell script that runs and grabs the security logs from our Domain controllers. We would like to either filter out results from the created .csv file or adjust the script to give us all the data for a certain event ID. The below is a copy of the current Powershell script we use to grab the logs.

 

cls

$computer = gc env:computername

$mypath = "c:\"

$dt=(get-date).AddDays(-1).tostring("MM-dd-yyyy")

$obj = New-Object System.Globalization.CultureInfo -ArgumentList "en-US"

$before = [DateTime]::Parse((get-date).tostring("MM-dd-yyyy"), $obj)

$after = [DateTime]::Parse((get-date).AddDays(-1).tostring("MM-dd-yyyy"), $obj)

get-eventlog -logname security -after $after -Before $before|Export-Csv $mypath""$computer"_security_log_$dt.csv"

 

Any ideas?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.