Skip to content

Commit 6fd2a50

Browse files
authored
Merge pull request #196 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents b91d63b + d8b4f9f commit 6fd2a50

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Spamfilter/Invoke-ExecQuarantineManagement.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ Function Invoke-ExecQuarantineManagement {
2020

2121
# Interact with query parameters or the body of the request.
2222
Try {
23-
$TenantFilter = $Request.Body.tenantFilter
23+
$TenantFilter = $Request.Body.tenantFilter | Select-Object -First 1
2424
$params = @{
25-
Identity = $Request.Body.Identity
2625
AllowSender = [boolean]$Request.Body.AllowSender
27-
ReleaseToAll = [boolean]$Request.Body.Type
28-
ActionType = $Request.Body.Type
26+
ReleaseToAll = $true
27+
ActionType = ($Request.Body.Type | Select-Object -First 1)
28+
}
29+
if ($Request.Body.Identity -is [string]) {
30+
$params['Identity'] = $Request.Body.Identity
31+
} else {
32+
$params['Identities'] = $Request.Body.Identity
2933
}
30-
3134
New-ExoRequest -tenantid $TenantFilter -cmdlet 'Release-QuarantineMessage' -cmdParams $Params
3235
$Results = [pscustomobject]@{'Results' = "Successfully processed $($Request.Body.Identity)" }
3336
Write-LogMessage -headers $Request.Headers -API $APINAME -tenant $TenantFilter -message "Successfully processed Quarantine ID $($Request.Body.Identity)" -Sev 'Info'

0 commit comments

Comments
 (0)