Created
July 15, 2019 10:33
-
-
Save alexverboon/5d51e2d5c70f6b4f681c120c3cadb5ec to your computer and use it in GitHub Desktop.
Verify-MScoreHostedOutboundSpamFilterPolicy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Verify-MScoreHostedOutboundSpamFilterPolicy | |
{ | |
<# | |
.Synopsis | |
Verify-MScoreHostedOutboundSpamFilterPolicy | |
.DESCRIPTION | |
The Verify-MScoreHostedOutboundSpamFilterPolicy cmdlet verifies the configuation | |
of the outbound spam policy | |
Secure Score Reference: Set outbound spam notifications | |
#> | |
[CmdletBinding()] | |
Param | |
( | |
# The fully qualified name of the domain to be retrieved. | |
[Parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$true, | |
Position=0)] | |
[string]$DomainName | |
) | |
Begin | |
{ | |
# Office365 PS Module check | |
if (-not (Get-Module -ListAvailable -Name "msonline")) | |
{ | |
Write-Warning "Unable to load module MSOnline" | |
Exit | |
} | |
Try{ | |
Get-MsolDomain -ErrorAction stop | Out-Null | |
} | |
Catch{ | |
write-warning "You must call the Connect-MsolService cmdlet before running Verify-MScorePasswordPolicy" | |
} | |
} | |
Process | |
{ | |
$outboundspamSettings = (Get-HostedOutboundSpamFilterPolicy) | |
$output = [pscustomobject]@{ | |
Name = $outboundspamSettings.Name | |
BccSuspiciousOutboundMail = $outboundspamSettings.BccSuspiciousOutboundMail | |
NotifyOutboundSpam = $outboundspamSettings.NotifyOutboundSpam | |
Enabled = $outboundspamSettings.Enabled | |
BccSuspiciousOutboundAdditionalRecipients = $outboundspamSettings.BccSuspiciousOutboundAdditionalRecipients | |
NotifyOutboundSpamRecipients = $outboundspamSettings.NotifyOutboundSpamRecipients | |
} | |
} | |
End | |
{ | |
$output | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment