Skip to content

Commit ef47345

Browse files
committed
fix audit log search creation
1 parent 39edfae commit ef47345

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-AuditLogSearchCreation.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ function Start-AuditLogSearchCreation {
99
$ConfigTable = Get-CippTable -TableName 'WebhookRules'
1010
$ConfigEntries = Get-CIPPAzDataTableEntity @ConfigTable -Filter "PartitionKey eq 'Webhookv2'" | ForEach-Object {
1111
$ConfigEntry = $_
12-
$ConfigEntry.excludedTenants = $ConfigEntry.excludedTenants | ConvertFrom-Json
12+
if (!$ConfigEntry.excludedTenants) {
13+
$ConfigEntry | Add-Member -MemberType NoteProperty -Name 'excludedTenants' -Value @() -Force
14+
} else {
15+
$ConfigEntry.excludedTenants = $ConfigEntry.excludedTenants | ConvertFrom-Json
16+
}
1317
$ConfigEntry.Tenants = $ConfigEntry.Tenants | ConvertFrom-Json
1418
$ConfigEntry
1519
}

0 commit comments

Comments
 (0)