You can mimic the examples here:
https://www.pei.com/bulk-import-of-whitelist-or-blacklists-lists-into-o365/
How to pass a list of domains to EOP antispam (Allowed Domains) by powershell
Marc
631
Reputation points
I am trying to pass a list of domains present in a CSV file (Import-CSV) to "Allowed Domains" in a customised (no default) EOP antispam policy.
You helped me with -IPAllowList unfortunately I was not able to adapt it for the "Allowed Domains" list.
Thanks
Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,195 questions
Exchange | Exchange Server | Management
7,925 questions
Accepted answer
-
Andy David - MVP 157.8K Reputation points
2021-07-19T12:57:00.533+00:00
1 additional answer
Sort by: Most helpful
-
Andy David - MVP 157.8K Reputation points
2021-07-19T11:27:56.793+00:00 Yikes!
Don't do this. Instead allow domains via a transport rule