Public/Spamfilter/Set-SpamfilterReports.ps1

function Set-SpamfilterReports {
    Param(
        [Parameter(Mandatory)]
        [string]$DomainName,
        [Parameter()]
        [bool]$Enabled = $true
    )
    process {
        try {
            $Credential = Get-SpamFilterCredential
        }
        catch {
            throw "Failed to retreive Spamfilter credential: $_"
        }

        try {
            $DomainName = [System.Web.HttpUtility]::UrlEncode($DomainName)
            $Response = (Invoke-WebRequest -Credential $Credential -Uri "$($SpamfilterAPIBaseURL)/report/setautoenable/domain/$($DomainName)/enabled/$($Enabled)").Content
        }
        catch {
            throw "Failed to set report settings for domain $($DomainName): $_" 
        }
        $Response
    }
}