Dear @John Noble,
Good day, and I appreciate the detailed description of your issue. From my research, there is no direct "Import" button in Outlook on the web (or in the new Outlook) to upload a .txt file of blocked senders. The Blocked Senders list you exported from Classic Outlook is stored per mailbox (client-side + synced to the server).
That said, there are two practical ways to achieve what you’re trying to do:
Option 1. Quickest for a small list (Manual or Semi-Manual)
- Open Outlook on the web (outlook.office.com).
- Click the gear icon (Settings)
- Go to Mail > Junk email.
- Under Blocked senders and domains, click Add.
- Paste or type the addresses/domains one by one (or comma-separated in some cases).
- Click Save.
This is fine if your list is small (under 50–100 entries). For hundreds of entries, it becomes tedious.
Option 2. Best for larger lists - Use PowerShell
Since you want the blocks to apply at the server level (so they work everywhere, including Outlook on the web and mobile), the most efficient way is to use Exchange Online PowerShell. Steps:
1.Connect to Exchange Online PowerShell
Install-Module -Name ExchangeOnlineManagement # (only once)
Connect-ExchangeOnline
(Sign in with your Global Admin or Exchange Admin account.)
2.Import the List (for one specific user)
Assuming your .txt file has one email address or domain per line:
$blockedList = Get-Content -Path "C:\Temp\BlockedSenders.txt"
foreach ($entry in $blockedList) {
if ($entry.Trim() -ne "") {
Set-MailboxJunkEmailConfiguration -Identity "******@yourdomain.com" `
-BlockedSendersAndDomains @{Add = $entry.Trim()}
Replace:
- "C:\Temp\BlockedSenders.txt" > your actual file path
- "******@yourdomain.com" > the mailbox you want to update
3.Verify the Import
Get-MailboxJunkEmailConfiguration -Identity "******@yourdomain.com" |
Select-Object -ExpandProperty BlockedSendersAndDomains
This will show you the full list of blocked senders/domains.
Optional:
If you want these senders blocked for all users in the organization (recommended for spam), use the Tenant Allow/Block List. You can do this in the Microsoft 365 Defender portal.
Go to security.microsoft.com, search for Threat policies > Tenant Allow/Block Lists > Add.
I hope this information is helpful. Please follow these steps and let me know if it works for you. If not, we can work together to resolve this. Thank you for your patience and understanding. If you have any questions or need further assistance, please feel free to share them in the comments so I can continue to support you. I'm looking forward to your reply.
If the answer is helpful, please click "Accept Answer" and kindly upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.