Public/Spamfilter/Get-SpamfilterDomainDestination.ps1
function Get-SpamfilterDomainDestination { Param( [Parameter(Mandatory)] [string]$DomainName ) process { try { $Credential = Get-SpamFilterCredential } catch { throw "Failed to retreive Spamfilter credential: $_" } try { $DomainName = [System.Web.HttpUtility]::UrlEncode($DomainName) $Destinations = Invoke-WebRequest -Credential $Credential -Uri "$($SpamfilterAPIBaseURL)/domain/getroute/domain/$($DomainName)/" | ConvertFrom-Json } catch { throw "Failed to retreive destinations from Spamfilter: $_" } $Destinations } } |