Solved

Importing Blocked Domains from .txt files in Exchange 2010 (14.2)

Posted on 2014-09-23
4
480 Views
Last Modified: 2014-09-23
Hello.

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.
0
Comment
Question by:guruerror
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:becraig
ID: 40339549
Get-Content C:\junk_domains.txt | % {Set-SenderFilterConfig -BlockedDomainsAndSubdomains $_}

Open in new window


The get content is returning all the rows as one entry you need to say for each entry so we do a for each loop then run the command.
0
 

Author Comment

by:guruerror
ID: 40339758
Thanks for the quick reply.  I tried that and it returned the same error, individually for each domain name.

"Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain1.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Failed to convert @domain1.com from System.String to Microsoft.Exchange.Data.SmtpDomain. Error: Error while converting string '@domain1.com' to result type Microsoft.Exchange.Data.SmtpDomain: "@domain1.com" isn't a valid SMTP domain."
    + CategoryInfo          : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig

Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain2.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Failed to convert @domain2.com from System.String to Microsoft.Exchange.Data.SmtpDomain. Error: Error while converting string '@domain2.com' to result type Microsoft.Exchange.Data.SmtpDomain: "@domain2.com" isn't a valid SMTP domain."
    + CategoryInfo          : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig

Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain3.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Failed to convert @domain3.com from System.String to Microsoft.Exchange.Data.SmtpDomain. Error: Error while converting string '@domain3.com' to result type Microsoft.Exchange.Data.SmtpDomain: "@domain3.com" isn't a valid SMTP domain."
    + CategoryInfo          : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig

Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain4.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Failed to convert @domain4.com from System.String to Microsoft.Exchange.Data.SmtpDomain. Error: Error while converting string '@domain4.com' to result type Microsoft.Exchange.Data.SmtpDomain: "@domain4.com" isn't a valid SMTP domain."
    + CategoryInfo          : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig

Cannot process argument transformation on parameter 'BlockedDomainsAndSubdomains'. Cannot convert value "@domain5.com" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.SmtpDomain]". Error: "Failed to convert @domain5.com from System.String to Microsoft.Exchange.Data.SmtpDomain. Error: Error while converting string '@domain5.com' to result type Microsoft.Exchange.Data.SmtpDomain: "@domain5.com" isn't a valid SMTP domain."
    + CategoryInfo          : InvalidData: (:) [Set-SenderFilterConfig], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-SenderFilterConfig"
0
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 40339773
Remove the @ sign @xxx.xx is NOT a valid domain
Update your file to remove the @ sign

xxx.xx is a valid domain.

http://technet.microsoft.com/en-us/library/aa996920%28v=exchg.150%29.aspx
0
 

Author Closing Comment

by:guruerror
ID: 40339819
Perfect.  The @ was the problem.  Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question