Commands › Exchange Online

Set-SafeLinksPolicy

Exchange Online ExchangeOnlineManagement Set-*

Modify Safe Links policies in your cloud-based organization.

Quick start script

# Set-SafeLinksPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SafeLinksPolicy
$before | Format-List

# 3. Make the change (dry run first)
Set-SafeLinksPolicy -Identity <SafeLinksPolicyIdParameter> -WhatIf
Set-SafeLinksPolicy -Identity <SafeLinksPolicyIdParameter>

# 4. Verify and diff
$after = Get-SafeLinksPolicy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-SafeLinksPolicy [-Identity] <SafeLinksPolicyIdParameter>
 [-AdminDisplayName <String>]
 [-AllowClickThrough <Boolean>]
 [-Confirm]
 [-CustomNotificationText <String>]
 [-DeliverMessageAfterScan <Boolean>]
 [-DisableUrlRewrite <Boolean>]
 [-DoNotRewriteUrls <MultiValuedProperty>]
 [-EnableForInternalSenders <Boolean>]
 [-EnableOrganizationBranding <Boolean>]
 [-EnableSafeLinksForEmail <Boolean>]
 [-EnableSafeLinksForOffice <Boolean>]
 [-EnableSafeLinksForTeams <Boolean>]
 [-LocalizedNotificationTextList <Hashtable>]
 [-ScanUrls <Boolean>]
 [-TrackClicks <Boolean>]
 [-UseTranslatedNotificationText <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (18)

ParameterTypeRequiredWhat it controls
-Identity SafeLinksPolicyIdParameter yes The Identity parameter specifies the Safe Links policy that you want to modify. You can use any value that uniquely identifies the policy. For example:
-AdminDisplayName String The AdminDisplayName parameter specifies a description for the policy. If the value contains spaces, enclose the value in quotation marks (").
-AllowClickThrough Boolean The AllowClickThrough parameter specifies whether to allow users to click through to the original URL on warning pages. Valid values are:
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-CustomNotificationText String The custom notification text specifies the customized notification text to show to users. If the value contains spaces, enclose the value in quotation marks (").
-DeliverMessageAfterScan Boolean The DeliverMessageAfterScan parameter specifies whether to deliver email messages only after Safe Links scanning is complete. Valid values are:
-DisableUrlRewrite Boolean The DisableUrlRewrite parameter specifies whether to rewrite (wrap) URLs in email messages. Valid values are:
-DoNotRewriteUrls MultiValuedProperty The DoNotRewriteUrls parameter specifies the URLs that are not rewritten by Safe Links scanning. The list of entries allows users who are included in the policy to access the specified URLs that would otherwise be...
-EnableForInternalSenders Boolean The EnableForInternalSenders parameter specifies whether the Safe Links policy is applied to messages sent between internal senders and internal recipients within the same Exchange Online organization. Valid values are:
-EnableOrganizationBranding Boolean The EnableOrganizationBranding parameter specifies whether your organization's logo is displayed on Safe Links warning and notification pages. Valid values are:
-EnableSafeLinksForEmail Boolean The EnableSafeLinksForEmail parameter specifies whether to enable Safe Links protection for email messages. Valid values are:
-EnableSafeLinksForOffice Boolean The EnableSafeLinksForOffice parameter specifies whether to enable Safe Links protection for supported Office desktop, mobile, or web apps. Valid values are:
-EnableSafeLinksForTeams Boolean The EnableSafeLinksForTeams parameter specifies whether Safe Links is enabled for Microsoft Teams. Valid values are:
-LocalizedNotificationTextList Hashtable {{ Fill LocalizedNotificationTextList Description }}
-ScanUrls Boolean The ScanUrls parameter specifies whether to enable or disable real-time scanning of clicked links in email messages. Valid values are:
-TrackClicks Boolean The TrackClicks parameter specifies whether to track user clicks related to Safe Links protection of links. Valid values are:
-UseTranslatedNotificationText Boolean The UseTranslatedNotificationText specifies whether to use Microsoft Translator to automatically localize the custom notification text that you specified with the CustomNotificationText parameter. Valid values are:
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.