diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-PublicWebhooks.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-PublicWebhooks.ps1 index 3a4e60373847..648a32e76c1c 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-PublicWebhooks.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-PublicWebhooks.ps1 @@ -65,7 +65,8 @@ function Invoke-PublicWebhooks { } Add-CIPPAzDataTableEntity @WebhookIncoming -Entity $Entity } else { - return 'Not replying to this webhook or processing it' + $Body = 'This webhook is not authorized.' + $StatusCode = [HttpStatusCode]::Forbidden } $Body = 'Webhook Recieved' $StatusCode = [HttpStatusCode]::OK @@ -80,4 +81,4 @@ function Invoke-PublicWebhooks { StatusCode = $StatusCode Body = $Body }) -} \ No newline at end of file +}