Our Story

Who we are and how we solve complex IT challenges.

Our Certifications

Microsoft certifications and partnerships validating our technical expertise.

Leadership

Meet the Experienced Leadership Team Driving WME’s Success

Advisory Updates

Expert guidance on Microsoft, security, and compliance developments.

Case Studies

Real-world outcomes from complex Microsoft-focused IT engagements.

Podcast

Podcasts, panels, and interviews where WME leaders share how they help high-growth companies and IT partners scale.

Ebooks

Practical guides on the Microsoft moves you can’t afford to get wrong.

Financial Industry

Secure technology solutions for regulated banks and financial institutions.

Healthcare

Secure Microsoft solutions for compliant, connected, and modern healthcare organizations.

Manufacturing

Cloud and security solutions supporting modern manufacturing operations.

Non-Profit

Cost-efficient Microsoft solutions for mission-driven organizations.

Public Sector

Microsoft-based IT services for secure public sector modernization.

High Tech

Scalable cloud, security, and staffing for fast-growing technology companies.

SMBs

Scalable cloud, security, and staffing for fast-growing technology companies.

Cloud Migration Services

Transition your workloads to the cloud securely for greater scalability and performance.

Data Migration Services

Securely transfer your business data with minimal downtime and maximum integrity.

Application Migration Services

Move your applications seamlessly to modern platforms with minimal business disruption.

Identity & Security Migration Services

Strengthen identity management and security while transitioning to modern Microsoft solutions.

Security Solutions

Protect your business with proactive cybersecurity, compliance, and risk management solutions.

Endpoint Management

Secure, manage, and monitor every device with modern endpoint management solutions.

Licensing Optimization

Get discounted pricing, a dedicated licensing team, and a plan that fits how many seats you actually use.

Power Platform

Unlock the full potential of the Microsoft Power Platform Suite to streamline operations, automate repetitive tasks, and gain real-time insights that drive business growth.

Sharepoint Solutions

Supercharge your business productivity and enhance visibility through our proven SharePoint expertise.

IT Staffing

Connect with skilled IT professionals to strengthen your team and accelerate project delivery.

Accounting & Finance

Connect with experienced accounting and finance professionals to support your business goals.

How to Add an Entry to the Safe Senders List for All Users in Exchange Online

March 25, 2025
How to Add an Entry to the Safe Senders List in Exchange Online

Sometimes, important email can come to your users from external systems. Outlook for Web can sometimes block the images from these emails, requiring the user to add the email address to their safe senders list in order for the images to display properly. Microsoft does not provide a way to centrally manage this list from Exchange Online, so you must use an automated process if you want to add certain addresses to this list for all users.

This blog will detail a quick PowerShell script that can loop through each mailbox and add an email address to the safe senders list.

You will need the Exchange Online PowerShell module installed on your computer. If you do not have it installed, you can install it by opening PowerShell as an administrator and running:

install-module ExchangeOnlineManagement

How to Add External Email Addresses to Safe Senders List in Outlook for Web Using PowerShell

To initially add an address to the safe senders list, you really only need three lines of PowerShell.

connect-exchangeonline

$mbxs = (get-mailbox -resultsize unlimited -recipienttypedetails usermailbox).userprincipalname

$mbxs | set-mailboxjunkemailconfiguration -TrustedRecipientsAndDomains @{Add="<email address>"} -TrustedSendersAndDomains @{Add="<email address>"}

Note that depending on how many mailboxes are in your environment, this may take a while to run. This will only apply the safe sender entry to user mailboxes. If you want to include shared mailboxes, change the recipienttypedetails parameter to usermailbox,sharedmailbox.

Automate the Maintenance of Safe Senders List in Exchange Online with PowerShell Script

Your users can self-maintain this list, which means that some are likely to remove the entries you have added. This will also catch mailboxes that have been created after you initially added an entry to safe senders.

To maintain the safe senders list with your entries, run the following PowerShell script as a scheduled task.

connect-exchangeonline

$mbxs = get-mailbox -resultsize unlimited -recipienttypedetails usermailbox | select userprincipalname

$missing_entry = $mbxs | ForEach {get-mailboxjunkemailconfiguration -identity $_.UserPrincipalName} | where-object -filterscript {$_.TrustedSendersAndDomains -notcontains "<email address>"}

 

ForEach ($mbx in $missing_entry) {

$mbx | set-mailboxjunkemailconfiguration -TrustedRecipientsAndDomains @{Add="<email address>"} -TrustedSendersAndDomains @{Add="<email address>"}

}

Note that depending on how many mailboxes are in your environment, this may take a while to run. This will only apply the safe sender entry to user mailboxes. If you want to include shared mailboxes, change the recipienttypedetails parameter to usermailbox,sharedmailbox.

Final Thoughts

Maintaining a safe senders list so that emails properly display can be difficult sense Microsoft does not provide a central way of managing this list from Exchange Online. With these simple PowerShell scripts, you can add entries so that your users’ email displays properly.

Disclaimer

All content provided on this blog is for information purposes only. Windows Management Experts, Inc. makes no representation as to the accuracy or completeness of any information on this site. Windows Management Experts, Inc. will not be liable for any errors or omissions in this information nor for the availability of this information. It is highly recommended that you consult one of our technical consultants, should you need any further assistance.

 

Windows Management Experts

Now A Microsoft Solutions Partner for:

✓ Data & AI

✓ Digital and App Innovation

✓ Infrastructure

✓ Security

The Solutions Partner badge highlights WME’s excellence and commitment. Microsoft’s thorough evaluation ensures we’re skilled, deliver successful projects, and prioritize security over everything. This positions WME in a global tech community, ready to innovate on the cloud for your evolving business needs.

Contact us: sales@winmgmtexperts.com

Share:

Facebook
Twitter
LinkedIn

Get Microsoft Updates Before They Cost You Downtime

Retirement dates, licensing changes, and security updates from a Microsoft-exclusive team, sent when they matter, not on a filler schedule.

Related Posts

Get Microsoft Updates Before They Cost You Downtime

Retirement dates, licensing changes, and security updates from a Microsoft-exclusive team, sent when they matter, not on a filler schedule.
Subscription Form email