You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Spamfilter/Invoke-AddTenantAllowBlockList.ps1
+21-10Lines changed: 21 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
FunctionInvoke-AddTenantAllowBlockList {
1
+
functionInvoke-AddTenantAllowBlockList {
2
2
<#
3
3
.FUNCTIONALITY
4
4
Entrypoint
@@ -9,14 +9,24 @@ Function Invoke-AddTenantAllowBlockList {
9
9
param($Request,$TriggerMetadata)
10
10
11
11
$APIName=$Request.Params.CIPPEndpoint
12
+
$Headers=$Request.Headers
13
+
12
14
$BlockListObject=$Request.Body
13
-
if ($Request.Body.tenantId-eq'AllTenants') { $Tenants= (Get-Tenants).defaultDomainName } else { $Tenants=@($Request.body.tenantId) }
@@ -38,19 +48,20 @@ Function Invoke-AddTenantAllowBlockList {
38
48
}
39
49
40
50
New-ExoRequest@ExoRequest
41
-
42
-
$results.add("Successfully added $($BlockListObject.Entries) as type $($BlockListObject.ListType) to the $($BlockListObject.listMethod) list for $tenant")
QueueMessage='Still loading data for all tenants. Please check back in a few more minutes'
33
+
QueueId=$RunningQueue.RowKey
34
+
}
35
+
$Results=@()
36
+
} elseif (!$Rows-and!$RunningQueue) {
37
+
$TenantList=Get-Tenants-IncludeErrors
38
+
$Queue=New-CippQueueEntry-Name 'Tenant Allow/Block List - All Tenants'-Link '/tenant/administration/allow-block-list?customerId=AllTenants'-Reference $QueueReference-TotalTasks ($TenantList|Measure-Object).Count
39
+
$Metadata= [PSCustomObject]@{
40
+
QueueMessage='Loading data for all tenants. Please check back in a few minutes'
0 commit comments