need a powershell script to add whitelist entries in bulk

can someone provide a powershell script for Office 365 that I can use to add in 1000+ whitelist entries. [would like the script to key on a CSV input file.]

thanks in advance,

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
Does something like this work for you?

Import-Csv "D:\whitelist.csv"  | foreach { Set-MailboxJunkEmailConfiguration -Identity  $_.Identity -TrustedSendersAndDomains  @{Add=''} }

The csv should look something like this:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
siber1Author Commented:
thx Spravtek, but we would mostly be whitelisting IP's or domain names. how can we modify your script to account for that?
Zephyr ICTCloud ArchitectCommented:
I understood your question wrong probably ... Anyway, I will look into the script, I have to go for  a while now.

More information on how to block domains using poweshell can be found here:
Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

siber1Author Commented:
hello spravtek any update on this?
Zephyr ICTCloud ArchitectCommented:
Hi, have been looking into this yes, but first I'd like to ask which Office365 plan you have... Do you have an E1 plan or? There seems to be some mixed information regarding availability to the whitelist and such.

siber1Author Commented:
Hi Spravtek, we have the E3 plan
Zephyr ICTCloud ArchitectCommented:
I'm sorry for the late reaction between posts, weekend and all ...

The reason I'm asking about the E-plan is because you can be using FOPE, so that changes things...

Are you using something like this?
siber1Author Commented:
actually FOPE was changed to EOP. we are using EOP.

Zephyr ICTCloud ArchitectCommented:
Interesting.... I'm not really following the Office365 story ...

The only thing I could find is this, but how it relates to the EOP, I can't really say, I'd test it if I had Office365, let alone an E-plan.
siber1Author Commented:
does anyone else have an idea on this?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.