> For the complete documentation index, see [llms.txt](https://scripts.aaronjstevenson.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripts.aaronjstevenson.com/software/installers/microsoft-defender-for-endpoint.md).

# Microsoft Defender for Endpoint

## Overview

{% hint style="info" %}
**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.
{% endhint %}

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.

{% embed url="<https://learn.microsoft.com/en-us/defender-endpoint/mde-planning-guide>" %}

**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

{% hint style="warning" %}
**Note:** Each M365 tenant will have a different onboarding package. **You should not use the same onboarding package for multiple organizations.**
{% endhint %}

To retrieve the necessary onboarding package:

1. Login to the M365 tenant&#x20;
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

{% @github-files/github-code-block url="<https://github.com/wise-io/scripts/blob/main/scripts/InstallMicrosoftDefenderForEndpoint.ps1>" %}

***

## Parameters

`-OnboardingPackage`

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://scripts.aaronjstevenson.com/software/installers/microsoft-defender-for-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
