-
-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
357 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Takes a long time to run. Probably needs at 5mins. | ||
# Want to add logon events too | ||
|
||
$events = Get-WinEvent -Path C:\Windows\System32\winevt\Logs\Security.evtx | where { ($_.Id -eq 4624 -and $_.properties[8].value -eq 10) -or ($_.Id -eq 4634 -and $_.properties[4].value -eq 2) } | ||
|
||
foreach ($event in $events) { | ||
|
||
# userid will vary depending on event type: | ||
if ($event.Id -eq 4624) { $userid = $event.properties[5].value } | ||
if ($event.Id -eq 4634) { $userid = $event.properties[1].value } | ||
|
||
$event | Select TimeCReated, TaskDisplayName, Machinename, @{"Name" = "UserID"; "Expression" = { $userid } } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
# Untested probably doesn't work | ||
|
||
# Create RMMAlerts when a backup fails | ||
if (Test-Path -Path "C:\Program Files\Veeam\Endpoint Backup") { | ||
Write-Output "Veeam Installed" | ||
|
||
$event = Get-EventLog "Veeam Backup" -newest 1 -After (Get-Date).AddDays(-1) | Where-Object { $_.EventID -eq 0 } | ||
|
||
if ($event.entrytype -eq "Error") { | ||
write-host "We got an event that is an error from Veeam Backup!" | ||
Rmm-Alert -Category "veeam_backup_failed" -Body "Veeam Backup Failed on $(%computername%) - message: $($event.message)" | ||
} | ||
else { | ||
write-host "No errors here" | ||
} | ||
|
||
} | ||
else { | ||
Write-Output "Veeam not Installed | ||
exit 0" | ||
} | ||
|
||
|
||
Exit $LASTEXITCODE | ||
|
||
$event = Get-EventLog "Veeam Backup" -newest 1 -After (Get-Date).AddDays(-1) | Where-Object { $_.EventID -eq 0 } | ||
|
||
if ($event.entrytype -eq "Error") { | ||
write-host "We got an event that is an error from Veeam Backup!" | ||
Rmm-Alert -Category "veeam_backup_failed" -Body "Veeam Backup Failed on $(%computername%) - message: $($event.message)" | ||
write-host "We got an event that is an error from Veeam Backup!" | ||
Rmm-Alert -Category "veeam_backup_failed" -Body "Veeam Backup Failed on $(%computername%) - message: $($event.message)" | ||
} | ||
else { | ||
write-host "No errors here" | ||
write-host "No errors here" | ||
} | ||
else { | ||
Write-Output "Veeam not Installed | ||
exit 0" | ||
} | ||
|
||
|
||
Exit $LASTEXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Untested probably doesn't work | ||
|
||
$event = Get-EventLog "Veeam Backup" -newest 1 -After (Get-Date).AddDays(-1) | Where-Object { $_.EventID -eq 0 } | ||
|
||
if ($event.entrytype -eq "Error") { | ||
write-host "We got an event that is an error from Veeam Backup!" | ||
Rmm-Alert -Category "veeam_backup_failed" -Body "Veeam Backup Failed on $(%computername%) - message: $($event.message)" | ||
} | ||
else { | ||
write-host "No errors here" | ||
} | ||
else { | ||
Write-Output "Veeam not Installed | ||
exit 0" | ||
} | ||
|
||
|
||
Exit $LASTEXITCODE |
Oops, something went wrong.