$&#@!
My colleague, and fellow PowerShell fan, Richard Wakeman has just spent some time developing a script that administrators can use in conjunction with bad word list files to install them into an Exchange Labs domain. I am delighted to be able to provide this file for you here. As usual, use this at your own risk, and test it out fully before before running it in your production environment.
Richard also supplied me with bad word lists in multiple languages that he was able to extract from Microsoft ForeFront...so I have those in my possession if anyone wants them; send me an email. The word list is just in a text file, one word below the other. I would post them...but am unsure what sort of trouble I would get into with my mother if I did...surely her son does not know so many bad words!
Here is how you use the script...
SYNTAX:
ManageProfanityFilter.ps1 [-Rulename <String>] [-WordListFile <Strings>] [-RejectionReason <String>] [-ExceptForMembersOf <RecipientIdParameter>] [-RemoteURL <String>] [-LiveCredential <PSCredential>]
PARAMETERS:
-Rulename (required) Name of the new TransportRule to be created by the script.
-WordListFile (required) File Path for List of bad words to check.
-RejectionReason (Optional) Message that end users get when they try to send email to each other |
-ExceptForMembersOf (Optional) The groups which have exception to skip the check.
-RemoteURL (required) URL for the connection to the Remote PowerShell environment.
-LiveCredential (required) Credentials for the basic auth logon to the Remote PowerShell environment.
<EXAMPLE>
Populate credentials to variable:
$cred = Get-Credential
-or-
$Username = admin@mydomain.com
$Password = ConvertTo-SecureString 'MyPassword' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential $Username, $Password
.\ManageProfanityFilter.ps1 "Harassment Policy a-h" -WordListFile "English Profanity List a-h.txt" -RejectionReason "This message cannot be delivered because it contains inappropriate content as defined in the Harassment Policy." -ExceptForMembersOf Admins -RemoteURL https://ps.exchangelabs.com/powershell/ -LiveCredential $cred
</EXAMPLE>
Enjoy!
Jonny
