I need help on completing a PowerShell script in which I can get specific Security Event Logs and export it to CSV file. Currently, I have this line,
Get-EventLog -LogName Security 4720,4722,4725 -After ((Get-Date).AddDays(-1)) | Export-CSV "C:\EventLogs.csv"
This does get the security events that i want to get. However, the information it provide is incomplete. It does not include these 2 in the output,
- Account Name - Account that did the change
- Target Account - Account that was changed
Is there a way to include these 2 above?
I was told that Get-WinEvent is better suited to do this but i am fairly new to PowerShell scripting so I would really appreciate a little help. Thank you