Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexverboon/5d51e2d5c70f6b4f681c120c3cadb5ec to your computer and use it in GitHub Desktop.
Save alexverboon/5d51e2d5c70f6b4f681c120c3cadb5ec to your computer and use it in GitHub Desktop.
Verify-MScoreHostedOutboundSpamFilterPolicy
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