Every new Microsoft Defender tenant starts with the same hours of clicking through the Defender portal, Intune and Exchange Online. And afterwards it is hard to prove what you actually configured.

Defender Configurator is a free, open source PowerShell 7 tool with a graphical interface that makes this onboarding repeatable. You describe your standard once as blueprints and each customer in one file. The tool reads the tenant, shows exactly where it differs, applies only what you tick and writes a before/after report for the customer file.

The Apply Blueprints page comparing all menus with a sample tenant

Download it on GitHub · MIT License

How it works

  1. Sign in to the customer tenant: the Defender portal, Microsoft Graph for Intune and Exchange Online for email. Each sign-in is separate, and the tenant you are working on is always shown at the top.
  2. Compare. Choose a blueprint, or All menus, and click Read Tenant and Compare. Every setting shows Matches, Differs or why it cannot be set (a missing licence, for example).
  3. Apply. Tick the settings to change. The confirmation shows the tenant and every change, with a warning where a setting has a large effect.
  4. Report. Save an HTML report with the changes (before and after) and the full comparison.

Blueprints and customer files

The tool separates two kinds of configuration:

  • A blueprint holds what every tenant gets: your standard. There is one blueprint file per menu, and you rarely change them.
  • A customer file holds what only one customer gets: their device groups, tags, accounts, domains, IP ranges and mailboxes. It can also change a blueprint value for that customer only.

Both are plain JSON files. You can keep them in version control, review a change before you use it, and reuse the same standard for every customer. Both are applied from the Blueprints menu of the tool, with the same confirmation, fresh read and read-back as every other page.

BlueprintCustomer file
HoldsSettings that fit any tenantItems and values that belong to one customer
FilesOne per menu, in the Blueprint folderOne per customer, in the Customers folder
Applied onApply BlueprintsCustomer Settings
What apply doesSets each ticked setting to the blueprint valueAdds what is missing; never removes anything
Kept in gitYesNo: customer files are ignored, only the template is committed

What a blueprint file looks like

Every setting in a blueprint has an area (the group of settings it belongs to), a name, the value it should have, and the reason. The reason is shown next to the setting in the tool and in the HTML report, so the customer sees why a setting was changed and not only what changed.

{
  "menu": "Identities",
  "name": "Identities blueprint",
  "version": "1.0",
  "description": "Defender for Identity settings for a new customer tenant.",
  "settings": [
    { "area": "MdiFeatures", "name": "IsAutoWindowsAuditingEnabled", "value": true,
      "reason": "Missing auditing is a common cause of health issues and missed detections." },
    { "area": "MdiFeatures", "name": "IsAutoActivationEnabled", "value": true,
      "reason": "Eligible servers onboarded to Defender for Endpoint get the sensor automatically." },
    { "area": "MdiActionAccount", "name": "UseLocalSystem", "value": true,
      "reason": "Response actions run as Local System, so no extra account is needed." }
  ]
}

Values are true or false for switches, "Standard" or "Strict" for email policies, "Off", "AllDevices" or "TaggedDevices" for the enforcement scope, a quarantine policy name for the Teams quarantine settings, and true or an object with options for Intune policies.

A blueprint deliberately holds only settings that fit any tenant. Anything that belongs to one customer, such as a device group, a domain or a mailbox, goes in a customer file instead.

The six blueprints

The tool ships with a blueprint for each menu. The values below are the ones in the files today. They are a starting point: review them against your own standard and change what you want.

Defender portal

Needs the Defender sign-in.

SettingBlueprintWhy
Preview features: Defender XDR and Defender for IdentityOnNew capabilities appear as soon as Microsoft releases them in preview
Preview features: Defender for EndpointOnThe same for Defender for Endpoint
Preview features: Defender for Cloud AppsOnThe same for Defender for Cloud Apps

Preview features are supported but can still change, and they apply to every user of the tenant.

Endpoints

Needs the Defender sign-in. These are the Defender for Endpoint advanced features (Settings > Endpoints > Advanced features) and the enforcement scope of security settings management.

SettingBlueprintWhy
EDR in block modeOnBlocks malicious behaviour found by EDR, also when another antivirus is the primary one
Automatically resolve alertsOnCloses alerts when automated investigation finds nothing or remediates everything
Allow or block fileOnRequired for file indicators
Hide potential duplicate device recordsOnKeeps the device inventory free of duplicates
Custom network indicatorsOnRequired for IP, URL and domain indicators and for blocking unsanctioned cloud apps
Tamper protectionOnStops attackers and local administrators from switching off Defender protection
Show user detailsOnShows Entra ID user details during investigations
Microsoft Defender for Cloud AppsOnSends endpoint signals to Defender for Cloud Apps; needed for Enforce app access
Web content filteringOnEnables web content filtering policies and reports
Device discoveryOnFinds unmanaged devices on the network
Download quarantined filesOnKeeps quarantined files available for analysis
Streamlined connectivity for new onboardingOnNew onboarding packages use the consolidated Defender URL set
Streamlined connectivity for Intune and Defender for CloudOnDevices onboarded through Intune and Defender for Cloud use the consolidated URL set
Live response, and live response for serversOnAnalysts can open a remote shell on a device during an incident
Live response unsigned script executionOffOnly signed scripts may run through live response
Microsoft Intune connectionOnShares device risk with Intune for compliance and Conditional Access
Authenticated telemetryOnRejects telemetry from devices that cannot prove their identity
Share endpoint alerts with Microsoft PurviewOnShares endpoint alerts with Purview for insider risk and compliance
Use MDE to enforce security configuration settings from IntuneOnThe main switch of security settings management
Enforcement scope: Windows Client, Windows Server, domain controllers, Linux, macOSTagged devicesOnly devices with the tag MDE-Management get the Intune endpoint security policies

A few things to know about the Endpoints blueprint:

  • A feature the tenant has no licence for is shown as Cannot be set instead of failing.
  • With the enforcement scope on tagged devices, nothing happens on a device until it has the tag MDE-Management. You add that tag on the Device Tags page or through a customer file. AllDevices applies the Intune policies to every device of a platform, and the confirmation warns you about it.
  • Turning the main switch on in the portal resets every platform to all devices. The tool sends the blueprint’s platform values in the same request instead, so devices are never briefly in scope by accident.

Intune

Needs the Graph sign-in. These are four Defender policies in Intune, the same ones the Defender AV, Attack Surface Reduction, Forgotten Settings and AI Agent Protection pages create.

PolicyBlueprintWhy
Defender Antivirus policy Defender Antivirus - BaselineNetwork protection and PUA protection in block, cloud block level High, all samples sent automatically, daily quick scan at 12:00, CPU limit 50 %, local admin exclusions ignoredReal-time, behaviour, script, email, archive and cloud-delivered protection on, in 25 settings
Attack surface reduction rules policy ASR Rules - BaselineStandard, controlled folder access in auditMicrosoft’s three standard protection rules block from day one; the other rules audit until their events are reviewed
Forgotten Defender settings policy Defender - Forgotten SettingsFile hash computation, warn verdicts converted to block, protection during Windows setup, exclusions hidden from local admins and users, excluded files in the quick scan, Intel TDT onDefender settings the antivirus profile doesn’t show, so they are easily forgotten. A settings catalog policy (Devices > Configuration)
AI agent runtime protection policy AI Agent Runtime Protection - BaselineAuditDefender inspects supported local AI agents for prompt injection and high-risk actions. In audit mode it reports detections and blocks nothing, so you can review the events first

The value of a policy is true for the default options, or an object with only the options you want to change:

{ "area": "IntunePolicies", "name": "DefenderAntivirus",
  "value": { "NetworkProtection": "Audit", "CloudBlockLevel": "HighPlus" },
  "reason": "Network protection starts in audit for the first roll-out." },
{ "area": "IntunePolicies", "name": "AsrRules",
  "value": { "Mode": "Standard", "ControlledFolderAccess": "Audit" },
  "reason": "Standard protection rules in block, the others in audit." },
{ "area": "IntunePolicies", "name": "ForgottenSettings",
  "value": { "IntelTDTEnabled": "NotConfigured" },
  "reason": "No Intel processors at this customer." },
{ "area": "IntunePolicies", "name": "AiAgentProtection",
  "value": { "Mode": "Audit" },
  "reason": "Review the AI agent detections before blocking." }
PolicyOptionValues
Defender AntivirusNetworkProtection, PotentiallyUnwantedAppsBlock or Audit
CloudBlockLevelHigh, HighPlus or ZeroTolerance
SampleSubmissionSendAll or SendSafe
QuickScanTimethe daily quick scan, as "HH:mm"
CpuLimit5 to 100
IgnoreLocalAdminExclusionstrue or false
ASR rulesModeStandard, Block (all rules) or Audit (all rules)
ControlledFolderAccessAudit, Block or NotConfigured
Forgotten settingsEnableFileHashComputation, AllowSwitchToAsyncInspection, EnableConvertWarnToBlock, OobeEnableRtpAndSigUpdate, HideExclusionsFromLocalAdmins, HideExclusionsFromLocalUsers, QuickScanIncludeExclusionstrue, false or NotConfigured
IntelTDTEnabledOn, Off, Default or NotConfigured
AI agent runtime protectionModeAudit or Block

The AI agent runtime protection profile is new, so its settings aren’t written into the tool. Each time, the tool reads the template from Intune. It gives every protection method its audit option (or its block option), and also sets any main switch those methods depend on. A setting without such an option stays Not configured, and the AI Agent Protection page lists it in its preview.

The Intune blueprint works like the email policies:

  • When the policy is missing, applying creates it without an assignment, so no device gets it until you assign it to a group, a pilot group first.
  • When a policy with that name exists, the tool compares it setting by setting. If a setting is missing or has another value, it shows change it in Intune and names the settings. It never changes an existing policy.
  • Before creating the forgotten settings policy, the tool checks every setting against Intune’s own definitions. A setting Intune doesn’t offer is left out and named.
  • Exploit Protection, App and Browser Isolation and Application control are not in the blueprint, because they depend on files and choices that differ per customer. You create those on their own pages.

Identities

Needs the Defender sign-in. These are Defender for Identity settings.

SettingBlueprintWhy
Automatic Windows auditing configurationOnDefender for Identity configures the event auditing it needs on servers with a sensor
Automatic sensor v3.x activationOnEvery eligible server onboarded to Defender for Endpoint gets the sensor within about an hour
Response actions use Local SystemOnActions such as disabling a user run as the sensor’s Local System account

Automatic activation affects domain controllers and other eligible servers, so the confirmation warns you. Set it to false for a customer who wants to activate servers one by one.

Cloud Apps

Needs the Defender sign-in. These are Defender for Cloud Apps settings.

SettingBlueprintWhy
File monitoringOnNeeded for file policies and malware detection on files
Enforce app accessOnApps marked Unsanctioned are blocked on devices onboarded to Defender for Endpoint
User enrichmentOnCloud Discovery shows Entra ID user names instead of the identifiers from firewall and proxy logs
All Microsoft 365 connector components onOnWithout them, activity policies, file policies and many detections get no data
Microsoft Azure app connector enabledOnCollects Azure activity for alerts and investigations

Before you apply Enforce app access, check which apps are marked Unsanctioned: users lose access to them on their devices. The two connector settings only accept true, because only switching them on was recorded from the portal. A connector that doesn’t exist yet must first be connected in the portal, since that needs consent.

Email and Collaboration

Needs the Exchange sign-in, plus the Defender sign-in for MDO automation. Most settings need Defender for Office 365.

SettingBlueprintWhy
Anti-phishing policyStandardSpoof intelligence, DMARC handling, safety tips, and with MDO impersonation protection and mailbox intelligence
Anti-spam policiesStandardSpam, bulk and phishing actions, plus an outbound policy with sending limits and external forwarding blocked
Anti-malware policyStandardCommon attachments filter, zero-hour auto purge, only admins can release malware
Safe Attachments policyStandardAttachments are opened in a sandbox and malicious ones are blocked
Safe Links policyStandardLinks in email, Teams and Office apps are checked when clicked
Safe Attachments for SharePoint, OneDrive and TeamsOnFiles in SharePoint, OneDrive and Teams are checked too
Priority account protectionOnExtra protection and reporting for priority accounts
Zero-hour auto purge for TeamsOnRemoves malicious Teams messages detected after delivery
Teams quarantine policy for malware and for high confidence phishingAdminOnlyAccessPolicyOnly admins can release these messages
Users can report messages in TeamsOnUsers can report suspicious Teams messages
Remediate similar email, URL and file clusters automaticallyOnAutomated investigation removes messages similar to a confirmed threat without waiting for approval

Standard and Strict are Microsoft’s own recommended settings. A new policy applies to all accepted domains of the tenant and is turned on immediately; the confirmation lists the domains. An existing policy is never changed: when a policy with the blueprint’s name already exists with other values, the tool shows change it in the portal and leaves it alone.

Comparing and applying a blueprint

On the Apply Blueprints page you choose a menu, or All menus to load every blueprint together, so one read and one apply cover everything. After Read Tenant and Compare, every setting gets a status:

StatusMeaning
Matches the blueprintNothing to do
Differs from the blueprintThe tool can apply the blueprint value
Missing: ‘…’ is createdAn email or Intune policy with the blueprint’s name doesn’t exist yet; applying creates it
Exists with other values: change it in the portal (or in Intune)A policy with that name exists but doesn’t have the blueprint’s values; the tool leaves it alone
Not read, Not available, Cannot be setA sign-in isn’t connected, a licence is missing or the tenant doesn’t offer the setting. The reason is shown

Open in Window shows the comparison in a large window where you can hide the settings that already match. Then you tick what to change and click Apply Selected Settings. The confirmation shows the tenant, every change, and a warning for the settings with a large effect: automatic sensor activation, the enforcement scope, Enforce app access, user enrichment, the app connectors, new email policies, new Intune policies without an assignment, and the MDO automation approver. If the Defender, Exchange and Graph sign-ins belong to different tenants, the tool refuses to apply. Afterwards, Save Report writes the HTML report for the customer file.

Changing a blueprint

  • Edit a value or reason in the JSON file and click Reload.
  • Remove a line to leave that setting out of the blueprint entirely.
  • Save Tenant as Blueprint turns a tenant you configured by hand into a new blueprint file, which is the quickest way to capture your own standard.
  • For a one-off, copy a file, change the copy and load it with Other File…. For a customer you work with regularly, a customer file with overrides is the better choice (see below).

The tool checks every file when it loads it, and lists each problem: an unknown area or setting, a wrong value type, a duplicate, or an area that belongs to another menu.

What a customer file holds

You create a customer file with New from Template… on the Customer Settings page. You fill in only what applies to that customer, and leave the rest empty.

SectionWhat it holdsWhat applying doesSign-in
blueprintOverridesBlueprint values this customer wants differentlyUsed by Apply Blueprints while this customer is chosen
endpoints.deviceGroupsDevice groups, in the portal’s own formatAdds the groups whose name doesn’t exist yet, just above Ungrouped devicesDefender
endpoints.deviceTagsManual tags and the devices that get themAdds the tag to each device that lacks itDefender
endpoints.deviceTagRulesRules that tag devices automatically, also devices onboarded laterCreates the rule when no rule with that name existsDefender
identities.directoryServicesAccountsDefender for Identity gMSAsRegisters the gMSA when it isn’t registered yetDefender
rbac.rolesDefender XDR unified RBAC roles with their Entra ID groupsCreates the role and assigns it to the groupsGraph
cloudApps.managedDomainsThe customer’s own domainsAdds the missing domainsDefender
cloudApps.ipRangesNamed IP ranges with a categoryAdds a range when no custom range with that name existsDefender
email.reportedMessagesWhere messages reported in Outlook goSets the destination and the reporting mailboxExchange
email.priorityAccountsPriority accountsTags the missing usersExchange
email.impersonationProtectionUsers and partner domains to protectAdds them to the anti-phishing policyExchange
email.safeLinksDoNotRewriteURLs Safe Links must not rewriteAdds them to the Safe Links policyExchange
email.malwareAdminNotificationWho hears about malware from internal sendersSets this admin in the anti-malware policyExchange

The header and the tenant lock

"type": "DefenderConfigurator.Customer",
"version": 1,
"customer": "Contoso",
"tenantId": "00000000-0000-0000-0000-000000000000",
"description": "Contoso Belgium, onboarded November 2026",

customer is required and appears in the customer list, the reports and the reason of every override. Always fill in tenantId as well. With a tenant ID, the tool refuses to read or apply the file while you are signed in to any other tenant, on both the Customer Settings and the Apply Blueprints page. When you work for many customers, that lock is what stops you from applying one customer’s settings to another.

Overriding a blueprint value

An override uses the same area and name as the line in the blueprint file:

"blueprintOverrides": [
  { "area": "MdiFeatures", "name": "IsAutoActivationEnabled", "value": false,
    "reason": "Servers are activated one by one after a change request." },
  { "area": "MdoPolicies", "name": "AntiSpam", "value": "Strict",
    "reason": "Strict protection on request of the customer." },
  { "area": "MdeScope", "name": "MacOS", "value": "Off",
    "reason": "The Macs are managed with another tool." }
]

While this customer is chosen, the Apply Blueprints page compares and applies these values instead of the blueprint’s, and the reason starts with the customer’s name. An override can also add a setting the blueprint doesn’t set, for example an advanced feature such as Restrict correlation to within scoped device groups. When you later change a blueprint, every customer without an override for that setting gets the new value.

Device groups, tags and tag rules

Device groups are written in the portal’s own format, with number codes for the automation level and the rules:

"deviceGroups": [
  {
    "Name": "Servers",
    "Description": "Servers whose name starts with SRV-",
    "AutoRemediationLevel": 7,
    "IsUnassignedMachineGroup": false,
    "MachineGroupAssignments": [],
    "GroupRules": [
      { "OperatorType": 1, "Property": 0, "PropertyValue": "SRV-" },
      { "OperatorType": 0, "Property": 1, "PropertyValue": "" },
      { "OperatorType": 0, "Property": 2, "PropertyValue": "" },
      { "OperatorType": 4, "Property": 3, "PropertyValue": "[]" }
    ]
  }
]
CodeAutomation level (AutoRemediationLevel)
3Full: remediate threats automatically
7Semi: require approval for non-temp folders remediation
6Semi: require approval for core folders remediation
2Semi: require approval for any remediation
1No automated response
PropertyRule onOperatorTypePropertyValue
0Device name0 contains, 1 starts with, 2 ends withtext
1Domain0 contains, 1 starts with, 2 ends withtext
2Tag0 contains, 1 starts with, 2 ends withtext
3OS4 is one ofa list as text, for example "[\"Windows11\"]"

A group always has all four rules, and a device joins when all filled-in rules match. You don’t have to write this by hand: create the group with New Group… on the Device Groups page of a reference tenant, export it and paste it into the customer file. The tool removes the identifiers of the other tenant.

Device tags are manual tags on devices that exist now. Each device name must match exactly one device:

"deviceTags": [
  { "tag": "Server", "devices": ["SRV-DC01", "SRV-FILE01"] },
  { "tag": "MDE-Management", "devices": ["SRV-FILE01", "PC-PILOT01", "PC-PILOT02"] }
]

Tagging a few pilot devices with MDE-Management is how you start security settings management safely: with the enforcement scope on tagged devices, only those devices get the Intune endpoint security policies.

Device tag rules tag devices automatically, including devices onboarded later:

"deviceTagRules": [
  {
    "name": "Servers",
    "tag": "Server",
    "match": "AND",
    "conditions": [
      { "property": "DeviceName", "operator": "StartsWith", "value": "SRV-" },
      { "property": "OnboardingStatus", "operator": "In", "value": ["Onboarded"] }
    ]
  }
]
propertyoperatorvalue
DeviceNameEquals or StartsWithtext
DomainStartsWith or Equalstext
OSPlatformIna list such as ["WindowsServer2025"]
InternetFacingEqualstrue or false
OnboardingStatusInOnboarded, NotOnboarded, Unsupported, InsufficientInfo
TagsIna list of device tags

Before it creates a rule, the tool asks the portal how many devices match, just as the portal itself does.

Identities, roles and Cloud Apps

"identities": {
  "directoryServicesAccounts": [
    { "accountName": "gmsa_MDI", "domain": "contoso.local" }
  ]
},
"rbac": {
  "roles": [
    {
      "name": "SOC analyst",
      "description": "Investigates and handles alerts and incidents.",
      "permissions": [
        "microsoft.xdr/secops/securitydata/alerts/manage",
        "microsoft.xdr/secops/securitydata/response/manage"
      ],
      "groups": ["SG-SOC-Analysts"],
      "scopes": ["/"]
    }
  ]
},
"cloudApps": {
  "managedDomains": ["contoso.com", "contoso.be"],
  "ipRanges": [
    { "name": "Head office", "category": "Corporate", "subnets": ["203.0.113.0/24"], "tags": [] },
    { "name": "VPN", "category": "VPN", "subnets": ["198.51.100.10", "198.51.100.11"], "tags": [] }
  ]
}
  • gMSA: the account name without the domain and without the $, and the DNS name of the domain (contoso.local, not CONTOSO).
  • Roles: permission names start with microsoft.xdr/. The easiest way to get them right is to export a role from a configured tenant on the RBAC page. A group is an object ID or a display name that matches exactly one group. The scope is / for all workloads, or one or more of Mde, Mdo, Mdi, Mda and Mdc.
  • IP ranges: the category is one of Corporate, Administrative, Risky, VPN, Cloud provider or Other. Defender for Cloud Apps only sees public addresses, so the tool warns about private ones.

Email values

"email": {
  "reportedMessages": { "destination": "Both", "mailbox": "reportedmessages@contoso.com" },
  "priorityAccounts": ["ceo@contoso.com", "cfo@contoso.com"],
  "impersonationProtection": {
    "users": ["Jane Doe;jane.doe@contoso.com"],
    "domains": ["fabrikam.com"]
  },
  "safeLinksDoNotRewrite": ["https://intranet.contoso.com/*"],
  "malwareAdminNotification": "secops@contoso.com"
}

These values go into the policies the Email and Collaboration blueprint creates. When a policy doesn’t exist yet and the customer is chosen, Apply Blueprints creates it with these values already in it. When the policy exists, Customer Settings adds the missing entries and keeps what is already there. reportedMessages is the one setting that is replaced instead of added to: Microsoft, Both (Microsoft and a mailbox) or Mailbox.

Applying a customer file

After Read Tenant and Compare on the Customer Settings page, every item gets a status:

StatusMeaning
In placeNothing to do
MissingThe tool can add it
Exists with other valuesFor example an IP range with other subnets, or a role without a permission. Change it on its own page or in the portal; the tool doesn’t replace it
Cannot be compared or addedThe reason is shown: a device that isn’t found, a group name that matches two groups, a missing sign-in
In the tenant, not in the customer fileShown for information, for domains, IP ranges, device groups, tag rules and priority accounts. Never removed

You tick the items, or use Select All Missing, and click Apply Selected Items. As everywhere, the tool reads the tenant again just before it writes, checks the tenant in the same call and reads everything back. The report lists the items added, the full comparison and the overrides.

Putting it together

A typical onboarding of a new customer then looks like this:

  1. Create the customer file from the template, fill in the tenant ID and what this customer needs, and click Reload. The tool lists any mistakes with the name of the field.
  2. Sign in to the customer tenant and choose the customer on the Customer Settings page. From then on, Apply Blueprints uses the customer’s overrides and refuses any other tenant.
  3. On Apply Blueprints, choose All menus, compare, apply what you agree with, and save the report.
  4. On Customer Settings, compare, apply the missing items, and save that report too.
  5. Six months later, run the same comparison again. Anything someone changed in the meantime shows up as Differs or Missing.

Customer files contain customer data such as tenant IDs, users, domains and IP ranges, so the repository’s .gitignore keeps them out of git. The template and its complete example of every section are on GitHub.

What it covers

AreaWhat you can do
Defender portalPreview features and unified RBAC: roles from templates or your own selection of permissions, assigned to Entra ID groups
EndpointsAdvanced features (EDR in block mode, tamper protection, and so on), device groups, manual device tags, rule-based tag rules and the enforcement scope of security settings management
IntuneDefender Antivirus, forgotten Defender settings, ASR rules, Exploit Protection, App and Browser Isolation, Application control and AI agent runtime protection policies, a comparison of existing antivirus policies with the baseline, and an HTML document of your endpoint security policies
IdentitiesSensor health and coverage, automatic Windows auditing and sensor activation, gMSA directory accounts and the action account
Cloud AppsA check of what new tenants often miss, app connectors and Microsoft 365 components, file monitoring, user enrichment, Enforce app access, managed domains and IP ranges
Email and CollaborationMicrosoft’s Standard or Strict anti-phishing, anti-spam, anti-malware, Safe Attachments and Safe Links policies, your own policies from a JSON file, user reported settings, Teams protection, priority accounts, user tags and MDO automation

Intune policies are created without an assignment, and existing Intune and email policies are never changed.

Existing antivirus policies compared with the baseline, with sample policies

Safe by design

The tool is built for tenants that are not yours, so every change follows the same pattern:

  • Confirm: nothing changes until you confirm, and the confirmation names the tenant.
  • Read again: just before writing, the tool reads the tenant again and only writes what still differs.
  • Check the tenant: the tenant is checked in the same call as the change. If the Defender and Exchange sessions belong to different tenants, it refuses to apply.
  • Read back: afterwards every setting is read again and verified. A setting the portal refuses is reported as Not applied.

Requirements

  • Windows with PowerShell 7.
  • For the Defender portal pages: the community module XDRInternals (the tool offers to install it) and an account such as Security Administrator.
  • For the Intune pages: Microsoft Graph with DeviceManagementConfiguration.ReadWrite.All, through your own sign-in or a service principal.
  • For the email pages: the ExchangeOnlineManagement module, version 3.0 or later. Safe Attachments, Safe Links and impersonation protection need Defender for Office 365.

Start it with:

pwsh -File .\DefenderConfigurator.ps1

The README on GitHub has the full list of permissions, and APIs.md lists every service and endpoint the tool contacts.

A word about unofficial APIs

Many Defender portal settings have no public API. For those, the tool builds on XDRInternals and on requests recorded from the Defender portal itself, sent exactly the way the portal sends them. Microsoft does not document or support these APIs, so a portal update can break a setting without warning. Always check the result in the portal.

Feedback

Found a bug or have an idea? Open an issue on GitHub or contact me. Defender Configurator is released under the MIT License and provided as is, without warranty.