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" }