Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Invoke-ExecListBackup {
[CmdletBinding()]
param($Request, $TriggerMetadata)
$Type = $Request.Query.Type
$TenantFilter = $Request.Query.tenantFilter
$TenantFilter = $Request.Query.tenantFilter ?? $Request.Body.tenantFilter
$NameOnly = $Request.Query.NameOnly -eq $true
$BackupName = $Request.Query.BackupName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Function Invoke-ExecExcludeTenant {
$Name = $Request.Query.tenantFilter
if ($Request.Query.AddExclusion) {
$Tenants = Get-Tenants -IncludeAll | Where-Object { $Request.body.value -contains $_.customerId }
$Name = $Tenants.defaultDomainName -join ','

$Excluded = foreach ($Tenant in $Tenants) {
$Tenant.Excluded = $true
Expand All @@ -48,13 +49,14 @@ Function Invoke-ExecExcludeTenant {

if ($Request.Query.RemoveExclusion) {
$Tenants = Get-Tenants -IncludeAll | Where-Object { $Request.body.value -contains $_.customerId }
$Name = $Tenants.defaultDomainName -join ','
foreach ($Tenant in $Tenants) {
$Tenant.Excluded = $false
$Tenant.ExcludeUser = ''
$Tenant.ExcludeDate = ''
Update-AzDataTableEntity -Force @TenantsTable -Entity $Tenant
}
Write-LogMessage -API $APIName -tenant $($Name) -headers $Headers -message "Removed exclusion for customer $($Name)" -Sev 'Info'
Write-LogMessage -API $APIName -tenant $($Name) -headers $Headers -message "Removed exclusion for customer(s): $($Name)" -Sev 'Info'
$body = [pscustomobject]@{'Results' = "Success. We've removed $Name from the excluded tenants." }
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Function Invoke-EditSpamFilter {
param($Request, $TriggerMetadata)

$APIName = $Request.Params.CIPPEndpoint
$TenantFilter = $request.Query.tenantFilter
$TenantFilter = $Request.Query.tenantFilter ?? $Request.Body.tenantFilter
$Name = $Request.Query.name ?? $Request.Body.name
$State = $State ?? $Request.Body.state
$State = $Request.Query.State ?? $Request.Body.State

try {
$Params = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Function Invoke-RemoveSpamfilter {
$APIName = $Request.Params.CIPPEndpoint
$Headers = $Request.Headers

$TenantFilter = $Request.Query.tenantFilter ?? $Request.Query.tenantFilter
$TenantFilter = $Request.Query.tenantFilter ?? $Request.Body.tenantFilter
$Name = $Request.Query.name ?? $Request.Body.name


Expand Down
Loading