Importing Blocked Domains from .txt files in Exchange 2010 (14.2)
Posted on 2014-09-23
I'm trying to import a list of domain names from a .txt file into the Exchange 2010 Anti-Spam Sender Filtering.
The actual .txt file contains several hundred domain names, but for the sake of this post I've reduced it to 5 sample domain names (@domain1.com, @domain2.com, etc.) In the .txt file each domain name is on its own line, and the file resides on the root of the C: drive of the Exchange server in question.
I ran the following via the Exchange Management Shell:
Set-SenderFilterConfig -BlockedDomainsAndSubdomains (Get-Content C:\junk_domains.txt)
The Shell returned the following error:
"Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain1.com @domain2.com @domain3.com @domain4.com @domain5.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Cannot convert value "@domain1.com" to type "Microsoft.Exchange.Data.SmtpDomain". Error: ""@domain1.com" isn't a valid SMTP domain.""
+ CategoryInfo : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig"
Any assistance or insight that you can provide would be greatly appreciated. This is NOT mission critical, but I would like to figure it out sooner rather than later.
Thanks in advance.