Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Microsoft automatically blocks images on all external emails and there is no admin level configuration that ensures images are automatically shown to end-users unless it’s on their personal safe list. User could manually add the domains to their own safe list but that is cumbersome and not something we’d expect a user to perform.

To optionally add all domains to all of your users allow list you can run the following script using the Exchange Online V3 PowerShell modules.

Please follow Microsoft’s steps to connect to Exchange Online V3 if not previously setup. Connect to Exchange Online PowerShell | Microsoft Learn

  1. Connect to Exchange Online PowerShell

  2. Create a .ps1 file of the script below and run after connected to Exchange Online PowerShell

The script will add all of the domains used to send simulation campaigns to if you use the “A” option on initial run. If you would like to remove the domains from the safe list you can input a “R” to remove all of the domains.

<#
YOU MUST CONNECT to Exchange Online as a Global Admin for this script to run properly. 
Connect-ExchangeOnline
#>

# Prompt user to choose between adding or removing domains

$addDomains = ""
while ($addDomains -ne "a" -and $addDomains -ne "r") {
    $addDomains = Read-Host "Do you want to add or remove domains? (A/R)"
    $addDomains = $addDomains.Trim().ToLower()  # Trim whitespace and convert to lowercase
}

function Write-ProgressHelper {
    param (
        [int]$StepNumber,
        [string]$Message
    )

    Write-Progress -Activity 'Updating SafeList' -Status $Message -PercentComplete (($StepNumber / $steps) * 100)
}
$script:steps = ([System.Management.Automation.PsParser]::Tokenize((Get-Content "$PSScriptRoot\$($MyInvocation.MyCommand.Name)"), [ref]$null) | Where-Object { $_.Type -eq 'Command' -and $_.Content -eq 'Write-ProgressHelper' }).Count

$stepCounter = 0

# Get all active user type mailboxes
Write-ProgressHelper -Message 'Getting mailboxes' -StepNumber ($stepCounter++)
$Mailboxes = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
$totalMailboxes = $Mailboxes.Count
Write-Output "Total mailboxes: $totalMailboxes"
$processedMailboxes = 0

# Configure junk email settings for each mailbox
if ($addDomains -eq "a") {
  $JunkEmailConfig = @{
      Add = "ssuport.com", "supppot.com", "center-supports.com", "supoorts.com", "suporrt.com", "team-support.net", "supppot.net", "legal-user.com", "the-verification.com", "legals-team.com", "authenticatecenter.com", "ourlogin.co.uk", "mnminfo.com", "help-desc.com", "account-protector.com", "calendarsupdates.com", "appstatusupdate.com", "hr-updates.net", "itservicesector.com", "mailer-sender.com", "servicealerts.net", "status-pager.com", "nonreplies.com", "registerconfirmation.com"
  }
}
else {
  $JunkEmailConfig = @{
        Remove = "ssuport.com", "supppot.com", "center-supports.com", "supoorts.com", "suporrt.com", "team-support.net", "supppot.net", "legal-user.com", "the-verification.com", "legals-team.com", "authenticatecenter.com", "ourlogin.co.uk", "mnminfo.com", "help-desc.com", "account-protector.com", "calendarsupdates.com", "appstatusupdate.com", "hr-updates.net", "itservicesector.com", "mailer-sender.com", "servicealerts.net", "status-pager.com", "nonreplies.com", "registerconfirmation.com"
    }
}

# Configure junk email settings for each mailbox
Write-ProgressHelper -Message 'Configuring junk email settings' -StepNumber ($stepCounter++)
$i = 0
foreach ($Mailbox in $Mailboxes) {
    $MailboxIdentity = $Mailbox.PrimarySmtpAddress.ToString()
    Set-MailboxJunkEmailConfiguration -Identity $MailboxIdentity -TrustedSendersAndDomains $JunkEmailConfig
    $processedMailboxes++
    if ($addDomains -eq "a") {
      Write-Progress -Id 1 -Activity "Working..." -status "Added: $i of $($Mailboxes.Count)" -percentComplete (($i / $Mailboxes.Count) * 100)
      $i++
    }
    else {
      Write-Progress -Id 1 -Activity "Working..." -status "Removed: $i of $($Mailboxes.Count)" -percentComplete (($i / $Mailboxes.Count) * 100)
      $i++
    }
}
Write-Output "Processed mailboxes: $processedMailboxes"

  • No labels