I just checked
$Events = Get-WinEvent -FilterHashtable @{
LogName = 'Security'
Id = 4624
StartTime = "22/06/2024"
EndTime = "24/06/2024"
}
If you look at the members of the EventLogRecord class you will see that there is no Type property
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventing.reader.eventlogrecord
$Events | Get-Memeber
If you want to see all the values for each property you can do a Select-Object *
For example,, to watch only the first event in the extracted Event list
$Events[0] | Select-Object *
You will see that the Logon Type value is in the Message property
Unfortunately this property is a block of text
$Events[0].Message.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
It will therefore be necessary to filter the text using the Select-String command.
$Events | Where-Object { $_.Message | Select-String "Logon Type:\s+3"}
Another technique is to go through the properties of the EventLogRecord object
If you look at the properties property, you will see that the eighth value is Logon Type
$Events[0].Properties
So we can make the filter on this eighth value of the Properties property
$Events | Where-Object {$_.properties[8].value -eq 3}