Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-WinEvent #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

MacsInSpace
Copy link

@MacsInSpace MacsInSpace commented Dec 14, 2022

Updated and changed to use "Get-WinEvent"
Added extended filters. More descriptive than, for example, "ReplacementStrings[6]" in my opinion.
Removed old variable settings:


$LogonEvent=(Get-EventLog -LogName Security -InstanceId 4624 -After $30Days | Where {$_.ReplacementStrings[8] -eq $LogonType -and $_.ReplacementStrings[6] -ne "Window Manager"})[0]
$LoggedOnUser=($LogonEvent.ReplacementStrings[6])+'\'+($LogonEvent.ReplacementStrings[5])
$Date=$LogonEvent.TimeGenerated

Change to Get-WinEvent<br>
Added extended filters<br><br>
Removed old variable settings:<br><br>
$LogonEvent=(Get-EventLog -LogName Security -InstanceId 4624 -After $30Days | Where {$_.ReplacementStrings[8] -eq $LogonType -and $_.ReplacementStrings[6] -ne "Window Manager"})[0]<br><br>
$LoggedOnUser=($LogonEvent.ReplacementStrings[6])+'\'+($LogonEvent.ReplacementStrings[5])<br><br>
$Date=$LogonEvent.TimeGenerated<br><br>
Added PS to extend the schema. *Untested at 15/05/23*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant