Microsoft Security Tech Accelerator
Dec 06 2023, 07:00 AM - 12:00 PM (PST)
Microsoft Tech Community

Office 365 SafeLinks ATP custom URL

Brass Contributor


I'm looking to build a dynamic script that pulls known-phishing sites from various sources and add these dynamically to SafeLinks policy. I did a bit of research and unfortunately I have found no option to add custom blacklisted URLs onto Office 365 - I can manage the policy settings in general, but I can't find an option that would allow me to automate my own custom URLs and domains. Both Graph API (seemingly unable to manage ATP Safelinks at all) and Powershell (some Safelink management) do not seem to expose this option. 


Any help? 

Alex P

1 Reply
best response confirmed by Aleksander Pawlak (Brass Contributor)
How about this command?
Set-AtpPolicyForO365 -BlockUrls <MultiValuedProperty>

Keep in mind when you run the command above, it will overwrite any previous values that were in the blocklist, so you need to use the @Add to append.
set-AtpPolicyForO365 -BlockUrls @{add=''}

If you wish to automate, you could use Azure Automation Runbook to read phishing sites from various sources, and then run Set-AtpPolicyForO365 to update the block policy.

If this was helpful please click 'Mark as best response.'