Solved

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

Posted on 2014-09-23
4
459 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 28

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 28

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

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now