diff --git a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-UpdateTenants.ps1 b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-UpdateTenants.ps1 index 811d54b229be..d3ef1e2711c8 100644 --- a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-UpdateTenants.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-UpdateTenants.ps1 @@ -6,10 +6,7 @@ function Push-UpdateTenants { Param($Item) $QueueReference = 'UpdateTenants' $RunningQueue = Invoke-ListCippQueue | Where-Object { $_.Reference -eq $QueueReference -and $_.Status -ne 'Completed' -and $_.Status -ne 'Failed' } - if ($RunningQueue) { - Write-Host 'Update Tenants already running' - return - } + $Queue = New-CippQueueEntry -Name 'Update Tenants' -Reference $QueueReference -TotalTasks 1 try { $QueueTask = @{ @@ -30,4 +27,4 @@ function Push-UpdateTenants { $QueueTask.Status = 'Failed' Set-CippQueueTask @QueueTask } -} \ No newline at end of file +}