Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create a Distribution Group 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 >>…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

911 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