Query Details
# MDE - Sense triggers PowerShell with public IP network connection ## Query Information ### Description This query identifies Device Network connections to public IP addresses from PowerSehll, iniatiated by the MDE Sense Service. #### References ### Microsoft Sentinel ```kql DeviceNetworkEvents | where InitiatingProcessFileName == "powershell.exe" | where InitiatingProcessParentFileName == "SenseIR.exe" | where RemoteIPType == 'Public' | extend ScriptPath = extract(@"([a-zA-Z]:\\[^\']+\.ps1)", 1, InitiatingProcessCommandLine) | extend IPInfo = geo_info_from_ip_address(RemoteIP) | project TimeGenerated, DeviceId, DeviceName, ScriptPath,InitiatingProcessCommandLine, RemoteIP, IPInfo.country ```
This query is designed to identify network connections made from a device to public IP addresses using PowerShell, specifically when initiated by the MDE (Microsoft Defender for Endpoint) Sense Service. Here's a breakdown of what the query does:
Data Source: It looks at DeviceNetworkEvents, which contains records of network activities on devices.
Filter Criteria:
powershell.exe.SenseIR.exe, indicating that the connection was initiated by the MDE Sense Service.Data Extraction:
Output:
In simple terms, this query helps security analysts identify when PowerShell scripts, triggered by the MDE Sense Service, connect to public IP addresses, providing details about the script and the geographical location of the IP.

Alex Verboon
Released: August 29, 2025
Tables
Keywords
Operators