Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-09-23
4
Medium Priority
?
533 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 2000 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

Industry Leaders: 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

Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

877 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