Skip to content

Commit ee17e66

Browse files
add exlcuded tenant to list
1 parent 624dc2d commit ee17e66

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-ListAlertsQueue.ps1

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ Function Invoke-ListAlertsQueue {
3131
$TranslatedActions = ($Task.Actions | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue).label -join ','
3232
$Tenants = ($Task.Tenants | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue)
3333
$TaskEntry = [PSCustomObject]@{
34-
Tenants = @($Tenants.label)
35-
Conditions = $TranslatedConditions
36-
Actions = $TranslatedActions
37-
LogType = $Task.type
38-
EventType = 'Audit log Alert'
39-
RowKey = $Task.RowKey
40-
PartitionKey = $Task.PartitionKey
41-
RepeatsEvery = 'When received'
42-
RawAlert = @{
34+
Tenants = @($Tenants.label)
35+
Conditions = $TranslatedConditions
36+
excludedTenants = ($Task.excludedTenants | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue)
37+
Actions = $TranslatedActions
38+
LogType = $Task.type
39+
EventType = 'Audit log Alert'
40+
RowKey = $Task.RowKey
41+
PartitionKey = $Task.PartitionKey
42+
RepeatsEvery = 'When received'
43+
RawAlert = @{
4344
Conditions = @($Conditions)
4445
Actions = @($($Task.Actions | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue))
4546
Tenants = @($Tenants)
@@ -64,15 +65,16 @@ Function Invoke-ListAlertsQueue {
6465

6566
foreach ($Task in $ScheduledTasks) {
6667
$TaskEntry = [PSCustomObject]@{
67-
RowKey = $Task.RowKey
68-
PartitionKey = $Task.PartitionKey
69-
Tenants = @($Task.Tenant)
70-
Conditions = $Task.Name
71-
Actions = $Task.PostExecution
72-
LogType = 'Scripted'
73-
EventType = 'Scheduled Task'
74-
RepeatsEvery = $Task.Recurrence
75-
RawAlert = $Task
68+
RowKey = $Task.RowKey
69+
PartitionKey = $Task.PartitionKey
70+
excludedTenants = $Task.excludedTenants
71+
Tenants = @($Task.Tenant)
72+
Conditions = $Task.Name
73+
Actions = $Task.PostExecution
74+
LogType = 'Scripted'
75+
EventType = 'Scheduled Task'
76+
RepeatsEvery = $Task.Recurrence
77+
RawAlert = $Task
7678
}
7779
if ($AllowedTenants -notcontains 'AllTenants') {
7880
$Tenant = $TenantList | Where-Object -Property defaultDomainName -EQ $Task.Tenant

0 commit comments

Comments
 (0)