Solved

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

Posted on 2014-09-23
4
501 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In-place Upgrading Dirsync to Azure AD Connect
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

628 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