![]() ![]() Select the condition, click on the underlined words in the lower part of the dialog box then type the domain name you want the rule to apply to. If you are using Outlook 2010 and up, you can create a rule " with specific words in the sender's address", highlighted in the red box in the screenshot. Outlook 2010 and up "words in the address" method If you don't want to use Exceptions, you can look for /ou in the address instead. Internal Exchange email does not use a SMTP address and therefore, does not contain an sign. You can copy and paste the above into your own PowerShell script or download the script here.To apply a rule only to internal Exchange email, create a rule that applies to all mail and add an exception for messages with in the sender's address. New-TransportRule $ruleName -SenderDomainIs $newSafeDomainList -SetSCL "-1" $newSafeDomainList = $newSafeDomainList | sort ![]() Set-TransportRule $ruleName -SenderDomainIs $completeList ![]() $completeList = $completeList | select -uniq | sort $completeList = $safeDomainList + $newSafeDomainList $safeDomainList = Get-TransportRule $ruleName |select -ExpandProperty SenderDomainIs If (Get-TransportRule $ruleName -EA Silentl圜ontinue) $tmpdomain = $domain -replace the rule already exists update the existing allowed sender domains, else create a new rule. $newSafeDomainList = += foreach ($domain in $safeDomainList) #Create a new array and remove all text for each line up to and including the symbol, also remove whitespace $safeDomainList = Get-Content $domainListFilePath #Read the contents of the text file into an array The script works by creating an array of domains and supplying that array to the set-TransportRule cmdlet. If you specify a rule name that does not already exist, a new rule will be created instead.The list is sorted into alphabetical order for easier readability the Office 365 Portal to view the rule.If you specify a rule name that already exists, the contents of the “SenderDomains” property will be loaded into an array and combined with the new list.Specify a meaningful rule name, this will help you segregate different groups of domains easily.Or without parameters and you will be prompted:.\Add365SafeDomains.ps1 -ruleName "Safe Domain List" -domainListFilePath "c:\domainlist.txt" Run the script that you downloaded (Add365SafeDomains.ps1).Connect to Exchange Online using PowerShell.The script will strip the first part of the address to leave only the domain name remaining. Create a plain text file containing a list of domains or email addresses.Creating a Mail Flow rule to handle many trusted domains. So I wrote a PowerShell script that would do the job of creating a transport rule based on a simple list from a text file containing email domains. I was working with a customer today that had a long list of domains that they wanted to white-list, but the Office 365 admin interface does not provide a facility to enter a list in bulk. There is a nice guide on how to achieve that in this blog post by Robert Crane. ![]() There are plenty of blog posts that explain how to add a mail flow rule in Office 365 to allow you to white list a sender domain, bypassing the 365 spam filtering completely. How to Bulk Whitelist domains in Office 365 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |