Forum Discussion
techboy127
Sep 01, 2026Copper Contributor
Policy backup
Is it possible to backup the defender(custom antispam, anti phishing etc) policies. So they can be easily restored. As a disaster recovery mechanism or if I have to setup the tenant afresh. If yes wh...
DerekMorgan2
Nov 09, 2026Brass Contributor
Hi, techboy127 - adding on to sateshbabulal1105's reply, Microsoft365DSC is my preferred option here. It exports Defender policies and the rest of your tenant as declarative files you can version and re-apply. Unattended runs need an app registration and certificate.
Export-M365DSCConfiguration -Components @('EXOHostedContentFilterPolicy','EXOHostedContentFilterRule') -Path .\exportAlternatively, build it on Azure Automation: a runbook using a managed identity pulls policies on a schedule and writes them to versioned Blob Storage.
Exchange Online PowerShell:
Get-HostedContentFilterPolicy | ConvertTo-Json -Depth 10
Graph TCM snapshot (needs Entra P1; snapshots expire after 7 days, so copy them out):
POST /v1.0/admin/configurationManagement/configurationSnapshots/createSnapshot Test a restore either way.