This folder adds optional Microsoft Defender for Endpoint (MDE) artifacts on top of the core intune-my-macs deployment.
To use
--mde, you must provide your own onboarding payload and a matching XML manifest.
Microsoft Defender for Endpoint depends on the device being enrolled and managed, which
requires Microsoft Company Portal to be present. The MDE install script
(scr-mde-100-install-defender.zsh) assumes Company
Portal (and the resulting management channel) already exists on the device, so Company
Portal must be deployed and installed before MDE onboarding runs.
Pick one canonical Company Portal install path — do not use both:
| Path | Artifact | When to use |
|---|---|---|
| Managed app (recommended/canonical) | APP-SYS-001 PKG (apps/CompanyPortal-Installer.pkg) deployed as a required macOS PKG app (VPP/managed). |
Standard deployments. Intune installs Company Portal as a managed app before scripts run. |
| Script install (alternative) | scr-app-100-install-company-portal.sh |
Only when you cannot use the managed PKG app. |
Deploying Company Portal via both the managed PKG app and the install script at the
same time causes duplicate installs and update-detection conflicts. Choose one path,
confirm Company Portal is installed, and only then enable --mde.
mainScript.ps1 will only deploy MDE content when you pass the --mde switch and both of the following exist in this folder:
- Onboarding payload – Your tenant-specific
.mobileconfigfile. - Matching XML manifest – An XML manifest that points to that
.mobileconfigfile.
Only after these are in place should you run:
pwsh ./mainScript.ps1 --assign-group "<your group>" --mdeGeneral prerequisites (PowerShell, APNS, permissions) are documented in the root README.md. This file focuses on MDE specifics only.
- Sign in to the Microsoft Defender Portal.
- Go to system > Settings > Endpoints > Device management > Onboarding.
- Select Operating system: macOS.
- Select Deployment method: Mobile Device Management / Microsoft Intune.
- Download the onboarding package.
You will get a file called GatewayWindowsDefenderATPOnboardingPackage.zip. Extract the archive and, in the Intune folder, rename WindowsDefenderATPOnboarding.xml to cfg-mde-001-onboarding.mobileconfig.
Copy cfg-mde-001-onboarding.mobileconfig into macOS/mde in this project.
The onboarding file must be named exactly cfg-mde-001-onboarding.mobileconfig.
Security note: do not commit your onboarding file into a public fork of this repo.
Create macOS/mde/cfg-mde-001-onboarding.xml with the following content. The <SourceFile> value must match your onboarding payload name and path.
<MacIntuneManifest>
<ReferenceId>CFG-MDE-001</ReferenceId>
<Version>1.0</Version>
<Type>CustomConfig</Type>
<Name>CFG-MDE-001 - Microsoft Defender Onboarding Profile</Name>
<Description>Onboards Microsoft Defender for Endpoint using a macOS custom configuration (mobileconfig) profile.</Description>
<Platform>macOS</Platform>
<Category>Security</Category>
<SourceFile>macOS/mde/cfg-mde-001-onboarding.mobileconfig</SourceFile>
</MacIntuneManifest>At this point you should have:
macOS/mde/cfg-mde-001-onboarding.mobileconfig– your tenant-specific onboarding payload.macOS/mde/cfg-mde-001-onboarding.xml– the manifest above.
With the onboarding payload and manifest in place, you can include MDE in a run:
pwsh ./mainScript.ps1 --assign-group "<your group>" --mdeThe --mde switch tells mainScript.ps1 to:
- Import the onboarding custom configuration (
CFG-MDE-001). - Import the MDE settings catalog policy (
POL-MDE-001). - Import and assign the MDE install script (
SCR-MDE-100).
The script handles ordering automatically (install app, onboard, then apply settings).
cfg-mde-001-onboarding.mobileconfig– Required onboarding payload (supplied by you; not committed here).cfg-mde-001-onboarding.xml– Manifest for the onboarding profile (see template above).pol-mde-001-settings-catalog.json/.xml– Settings catalog policy for MDE.scr-mde-100-install-defender.zsh/.xml– Script and manifest to install the Defender agent.
For general MDE concepts (licensing, OS requirements, tuning, CLI), use Microsoft documentation:
-
Onboarding file not found
- Confirm the file is named
cfg-mde-001-onboarding.mobileconfig. - Confirm it is in the
macOS/mde/folder. - Confirm the
<SourceFile>incfg-mde-001-onboarding.xmlmatches exactly. - Confirm you ran
mainScript.ps1with--mde.
- Confirm the file is named
-
Device not appearing in Defender
- Verify the onboarding profile was created and assigned in Intune.
- On the Mac, run
sudo mdatp healthto check status. - Allow time for initial onboarding and portal reporting.
For broader troubleshooting and best practices, refer to the MDE docs linked above.
Built with ❤️ by the Microsoft Intune Customer Experience Engineering team