Microsoft Defender for Endpoint

PowerShell script to silently install Microsoft Defender for Endpoint (MDE).

Overview

Dev Insight: This script can be used to deploy Microsoft Defender for Endpoint to domain joined devices seamlessly from your RMM of choice while you plan your migrations from Active Directory to Entra joined devices.

This script utilizes the onboarding package script provided by Microsoft to install Microsoft Defender for Endpoint (MDE) on Windows devices, including Windows 10 - 11 and Windows Server 2012 R2 - 2025.

Prerequisites:

  • Microsoft user licenses that include MDE (such as Microsoft 365 Business Premium)

  • Microsoft Defender for Endpoint server licenses (such as Microsoft Defender for Business servers)

  • The MDE Onboarding Package for the M365 tenant being onboarded


Setup

To retrieve the necessary onboarding package:

  1. Login to the M365 tenant

  2. Navigate to the Security portal

  3. Click Settings > Endpoints > Onboarding

  4. Select Windows 10 / 11 as OS type

  5. Download the Onboarding Package and save at a location accessible to the script


Script

https://github.com/wise-io/scripts/blob/main/scripts/InstallMicrosoftDefenderForEndpoint.ps1

Parameters

-OnboardingPackage

Path to the onboarding package. File extension should be .zip.

Last updated

Was this helpful?