Microsoft Defender XDR
Hunting and detection

Advanced Hunting Migrate From Mde

In brief

The documentation now clarifies migration queries from Microsoft Defender for Endpoint, including PowerShell technique filtering, AlertInfo and AlertEvidence joins, and entity filtering. It also updates the Microsoft Defender XDR setup link and publication date.

What Defender admins need to know

Administrators can use the revised examples to more accurately adapt existing queries and locate the current setup guidance.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Original Defender for Endpoint query

The following query usesfinds recent DeviceAlertEvents records in Microsoft Defender for Endpoint to get the alerts that are associated with PowerShell technique T1086 and involve powershell.exe:

DeviceAlertEvents
<a name="modified-query"></a>
### Modified query for Microsoft Defender XDR

The following query has been adjustedmigrates the original Defender for Endpoint query for use in Microsoft Defender.Defender XDR. Instead of checking the file name directly fromquerying `DeviceAlertEvents`, directly, it uses `AlertInfo` to filter by attack technique and joins `AlertEvidence` and checksto check for the file name in that table.name.

```kusto
AlertInfo

When Microsoft Defender for Endpoint rules are edited on Microsoft Defender, they continue to function as before if the resulting query looks at device tables only.

For example, alerts generated by custom detection rules that query only device tables will continue to be delivered to your SIEM and generate email notifications, depending on how you've configured theseSIEM delivery and email notifications in Microsoft Defender for Endpoint. Any existing suppression rules in Defender for Endpoint will also continue to apply.

Once you edit a Defender for Endpoint rule so that it queries identity and email tables, which are only available in Microsoft Defender, the rule is automatically moved to Microsoft Defender.


To get the same alert information that you used to get from the `DeviceAlertEvents` table in the Microsoft Defender for Endpoint schema, filter the `AlertInfo` table by the `ServiceSource` column. The `ServiceSource` column identifies which Microsoft 365 security product generated the alert, such as `Microsoft Defender for Endpoint`, `Microsoft Defender for Office 365`, or `Microsoft Defender for Identity`. After filtering by `ServiceSource`, join each unique ID with the `AlertEvidence` table, which provides detailed event and entity information.

The following sample query filtersnarrows `AlertInfo` to alerts generated by `ServiceSource`Microsoft Defender for Endpoint and joins `AlertEvidence` on `AlertId`: to retrieve the associated evidence:

```kusto
AlertInfo
| join AlertEvidence on AlertId

ThisThe previous query yields many more columns than DeviceAlertEvents in the Microsoft Defender for Endpoint schema. To keep results manageable, use project to get only the columns you are interested in. The following query projectsbuilds on the previous example by adding a PowerShell filter and using project to return only the columns that are useful when investigating PowerShell activity:

AlertInfo
| project Timestamp, Title, AlertId, DeviceName, FileName, ProcessCommandLine

If you'd like toYou can also filter for specific entities involved in the alerts, you can do so by specifyingalerts. Building on the entity type in EntityType andprevious examples, the value you would like to filter for. The following query retrieves all evidence forlooks up a specific alert title by joiningtitle, joins AlertInfo with AlertEvidence, to retrieve the related evidence records, and then filtersnarrows the results to a specific IP address:address by filtering on EntityType and RemoteIP:

AlertInfo

For more information about advanced hunting and Microsoft Defender XDR, see the following articles:

- [Turn on Microsoft Defender]Defender XDR](advanced-hunting-query-language.m365d-enable.md)
- [Advanced hunting overview](advanced-hunting-overview.md)
- [Understand the schema](advanced-hunting-schema-tables.md)
- [Advanced hunting in Microsoft Defender for Endpoint](/windows/security/threat-protection/microsoft-defender-atp/advanced-hunting-overview)