Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exchange 2010 Bypassed Senders Domains Content Filter Config

Posted on 2012-03-19
6
Medium Priority
?
2,458 Views
Last Modified: 2012-04-11
I'm trying to import a CSV file with a list of domains to be added to the BypassedSenderDomains list, however I don't seem to be having much success.  Here is the script I am using:

$domains = import-csv "e:\WhiteList.csv"
foreach($domain in $domains){
$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add($domain.”dom”)
}
set-contentfilterconfig -BypassedSenderDomains:$list

Am i right, in that I'm just copying and pasting this into powershell?

After this is done, the powershell remains at the >> prompt, which I don't know how to get out of, aside from just closing it out, and reopening.  Also when trying to see if the list populated by typing Get-ContentFilterConfig, nothing happens, but returns to a blank line with >>

My csv file is formatted with the dom as the column name, and the list of columns below it.
0
Comment
Question by:fireguy1125
[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
  • 4
  • 2
6 Comments
 
LVL 43

Expert Comment

by:Adam Brown
ID: 37738587
It looks like you're trying to add entries by using the get-contentfilterconfig cmdlet. That's not actually possible. You have to use set-contentfilterconfig to add the entries to the list. So instead of your
$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add($domain.”dom”)
lines, use
set-contentfilterconfig -bypassedsenderdomains $list
0
 
LVL 1

Author Comment

by:fireguy1125
ID: 37766336
I replaced the Get-ContentFilterConfig text with Set-ContentFilterConfig text, however same thing, it's still at the prompt with the >> and not applying my list.

Can you please provide the full entry I need perform my csv import.

Thank you.
0
 
LVL 1

Author Comment

by:fireguy1125
ID: 37766798
I even tried doing this manually without importing a csv file, doing as follows:

At the PS prompt:

$list = (Get-ContentFilterConfig).BypassedSenderDomains
$List.add(“*.microsoft.com”,"*.dell.com")
set-contentfilterconfig -bypassedsenderdomains:$list

However after enterting the $List.add command, I'm getting an error as follows:

Cannot find an overload for "Add" and the argument count: "2"
At line:1 char:10
+ $List.add <<<< (*.microsoft.com","*.dell.com")
+CategoryInfo: NotSpecified: (:) [], MethodException
+FullQualifiedErrorId: MethodCountCouldNotFindBest
0
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!

 
LVL 1

Author Comment

by:fireguy1125
ID: 37767703
It doesn't seem to like multiple entries. when I enter a domains individually in the $List.add command, it goes through fine, but when I try adding more than when, seperating domains with a comma, with or without quotation marks, it errors out.
0
 
LVL 43

Accepted Solution

by:
Adam Brown earned 2000 total points
ID: 37768084
You have to add them one at a time. From a CSV you would do this:

$import = import-csv <file>
foreach ($domain in $import)
{
set-contentfilterconfig -bypassedsenderdomains $domain.<heading>
}

Replace <heading> with whatever you have as the first line for the domain's your adding in your CSV file.
0
 
LVL 1

Author Closing Comment

by:fireguy1125
ID: 37835123
I've been adding it one at a time, a paint, but couldn't get the csv import to work.
0

Featured Post

WEBINAR - Latest Cyber Tips for Defense

Join the WatchGuard Threat Research Team on October 26th for an informative webinar featuring expert tips and tricks for defending your organization from today's latest cyber threats. Don't leave yourself vulnerable to attack. Register for the webinar today!

Question has a verified solution.

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

Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
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 …
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
Suggested Courses

610 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