i want to figure out which user, ip, workstationname connects remotly to a station. This could be seen in the eventlog eventid 4624 logontype 10 (remoteinteractive, such as rdp). When this case happens, i need some data from the message field, but only some not all.
Get-WinEvent -FilterHashtable @{Path="c:\temp\raw_data\SavedSecurity.evtx";} |Where {($_.id -eq "4624" -and $_.properties[8].value -in 10)} |Select-Object -Property TimeCreated, Message |pause
I know i can get a lot of data with the provided code, also the remote-ip, remoteworkstationname, remoteuserid withhin the message field.
Here comes the challenge: i only want some data from the message field:
TargetUserName testuser
TargetDomainName testlab.internal
TargetLogonId 0xb6f45e
LogonType 7
WorkstationName testclientwin7
IpAddress 127.0.0.1
IpPort 64372
Message: Successful Login
Any ideas how to write them (only this fields, not the additional ones) to a csv file with headernames the same as the selected data-items?
thanks
peter