Get all malwares detections


Userlevel 6
Badge +4

Hello,

With some people help me, I have this "script" to get all differents malwares detections based on date + VM name + Path.
This is usefull to avoid read several files.

 

$Path = "C:\ProgramData\Veeam\Backup\Malware_Detection_Logs\"
$Files = (Get-ChildItem -Path $Path).FullName

Select-String -Path $Files -Pattern '^\[(?<Date>[^\]]+).+\s(?<VM>[^:]+):.+?:(?<File>.+)' -AllMatches |
ForEach-Object {
$match = $_.Matches[0]
[PSCustomObject]@{
Date = $match.Groups['Date'].Value
VM = $match.Groups['VM'].Value
File = $match.Groups['File'].Value
}
} |
Sort-Object VM, File -Unique

 


2 comments

Userlevel 7
Badge +2

Wow, that’s great script, thank you @damien commenge for sharing.

Userlevel 7
Badge +20

That is an awesome script!  Thanks for sharing Damien.

Comment