Кста централизовано логи + алерты от AppLocker как реализовано?
#Fetches Latest SRP event from EventVwr
$Event = Get-EventLog -LogName 'Application' -InstanceId 865,868 -Newest 1
#Send mail function
Function send_mail([string]$message,[string]$subject) {
$emailFrom = ""
$emailTo = ""
$smtpServer = ""
Send-MailMessage -SmtpServer $smtpServer -To $emailTo -From $emailFrom -Subject $subject -Body $message -BodyAsHtml -Priority High
}
#Fetches File Path from the end of string
$message = $event.Message
$length = ($message.Length - 305)
$path = $message.Substring(305, $length)
$path
#Bundles into Msg and send Email
$message = "An application has been blocked from running by Software Restriction Policies on "+ $env:COMPUTERNAME+ " for user " + $event.username + ". <br><br>Further information can be found in the Application Event Log. <br><br>" + $path
$subject = "Software Blocked by SRP " + $env:COMPUTERNAME
send_mail $message $subject