fireguy1125
asked on
Exchange 2010 Bypassed Senders Domains Content Filter Config
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). BypassedSe nderDomain s
$list.add($domain.”dom”)
}
set-contentfilterconfig -BypassedSenderDomains:$li st
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.
$domains = import-csv "e:\WhiteList.csv"
foreach($domain in $domains){
$list = (Get-ContentFilterConfig).
$list.add($domain.”dom”)
}
set-contentfilterconfig -BypassedSenderDomains:$li
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.
ASKER
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.
Can you please provide the full entry I need perform my csv import.
Thank you.
ASKER
I even tried doing this manually without importing a csv file, doing as follows:
At the PS prompt:
$list = (Get-ContentFilterConfig). BypassedSe nderDomain s
$List.add(“*.microsoft.com ”,"*.dell. com")
set-contentfilterconfig -bypassedsenderdomains:$li st
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: MethodCountCouldNotFindBes t
At the PS prompt:
$list = (Get-ContentFilterConfig).
$List.add(“*.microsoft.com
set-contentfilterconfig -bypassedsenderdomains:$li
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.
+CategoryInfo: NotSpecified: (:) [], MethodException
+FullQualifiedErrorId: MethodCountCouldNotFindBes
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've been adding it one at a time, a paint, but couldn't get the csv import to work.
$list = (Get-ContentFilterConfig).
$list.add($domain.”dom”)
lines, use
set-contentfilterconfig -bypassedsenderdomains $list