How I can Write-Output only:
- TimeCreated
- Account Name
- Account Domain
- Object type
- and object name.
Code:
Get-WinEvent -ComputerName DS1 -LogName Security -FilterXPath "*[System[EventID=4670 and TimeCreated[timediff(@SystemTime) <= 86400000]] and EventData[Data[@Name='ObjectType']='File']]" | fl
Here is the output of the script:
TimeCreated : 2020-04-15 7:38:42 AM
ProviderName : Microsoft-Windows-Security-Auditing
Id : 4670
Message : Permissions on an object were changed.
Subject:
Security ID: S-9-9-291-9999999999-8999992562-9999999661-999999
Account Name: todd
Account Domain: dmn
Logon ID: 0x55555555555555
Object:
Object Server: Security
Object Type: File
Object Name: F:\Share\share1\photo.png
Handle ID: 0x70a2
Process:
Process ID: 0x5
Process Name:
Permissions Change:
Original Security Descriptor:
New Security Descriptor: O:S-9-9-291-9999999999-8999992562-9999999661-999999:DU