From cf9beb0c52e5b87f9f8a5c1bf38ae5c530ac2a25 Mon Sep 17 00:00:00 2001 From: Troy Harshberger Date: Wed, 21 Feb 2024 14:22:45 -0700 Subject: [PATCH] Add force sync queue trigger for IronScales --- ExecScheduledIronScales/function.json | 11 +++++++++++ ExecScheduledIronScales/run.ps1 | 17 +++++++++++++++++ Scheduler_IronScales/function.json | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ExecScheduledIronScales/function.json create mode 100644 ExecScheduledIronScales/run.ps1 diff --git a/ExecScheduledIronScales/function.json b/ExecScheduledIronScales/function.json new file mode 100644 index 000000000000..5905366c3373 --- /dev/null +++ b/ExecScheduledIronScales/function.json @@ -0,0 +1,11 @@ +{ + "bindings": [ + { + "name": "QueueItem", + "type": "queueTrigger", + "direction": "in", + "queueName": "phishingqueue" + } + ] + } + \ No newline at end of file diff --git a/ExecScheduledIronScales/run.ps1 b/ExecScheduledIronScales/run.ps1 new file mode 100644 index 000000000000..62bff3ad04d9 --- /dev/null +++ b/ExecScheduledIronScales/run.ps1 @@ -0,0 +1,17 @@ +param($QueueItem) + +try { + Write-LogMessage -API "ExecScheduled_IronScales" -tenant "none" -message "Starting IronScales processing." -sev Info + + $Table = Get-CIPPTable -TableName Extensionsconfig + $Configuration = (Get-CIPPAzDataTableEntity @Table).config | ConvertFrom-Json -Depth 10 + if(!$Configuration.IronScales.enabled) { + return + } + + Get-IronScalesIncidents -configuration $Configuration.IronScales +} +catch { + Write-Host $($_.Exception.Message) + Write-LogMessage -API "Scheduler_IronScales" -tenant "none" -message "Could not start IronScales processing $($_.Exception.Message)" -sev Error +} diff --git a/Scheduler_IronScales/function.json b/Scheduler_IronScales/function.json index 77066171995a..06eab12b1cff 100644 --- a/Scheduler_IronScales/function.json +++ b/Scheduler_IronScales/function.json @@ -2,7 +2,7 @@ "bindings": [ { "name": "Timer", - "schedule": "0 */5 * * * *", + "schedule": "0 */30 * * * *", "direction": "in", "type": "timerTrigger" }