E=mc2
asked on
Powershell script to add an email in the Office 365 Security and Compliance Block List
I would like to use a script, preferably a PowerShell script to prompt for an email address and then add that email address to the Office 365 Security and Compliance Defaul spam filter policy
Block Sender list.
Is this possible?
Thanks in advance.
Block Sender list.
Is this possible?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Vasil much appreciated.
This seems to work once I add the following before your script.
Connect-MsolService -Credential $Credential
This seems to work once I add the following before your script.
Connect-MsolService -Credential $Credential
You have two options:
* Fill it up manually on the O365 S&C (security and compliance)
* Or manage the Default Spam Policy for everyone (mailbox by mailbox, but there's a cmdlet that does it all for everyone):
https://docs.microsoft.com/powershell/module/exchange/set-mailboxjunkemailconfiguration?view=exchange-ps
To a Single User:
Open in new window
To the whole companyOpen in new window