We have set up one Spam Filter policy in Exchange Online Protection with our allow and block sender and domain lists and we have created a second policy that we want to have the same allow and block lists.
Is there a way to basically copy or import/export the allow and block lists from one policy to the other using powershell?
It took a while to figure this out, but yes. Each list can be copied directly in a single command.
The trick was that you have to "walk" the objects returned using
ForEach-Object
. These four commands will copy all four allow/block lists: