Menu

Defender XDR with PowerShell 7: Advanced Hunting from the Command Line
📰

Defender XDR with PowerShell 7: Advanced Hunting from the Command Line

DEV Community: azure·Anthony Buhnerkemper·about 12 hours ago
#LBjOyfS8
#devtoazure#devto#dev#toolkit#powershell
Reading 0:00
15s threshold

I have worked in IT for about 20 years. A lot of that was MSP operations. Today I work as an M365 cloud admin.

I kept writing the same scripts. So I cleaned them up and shared them on GitHub. This toolkit is for Microsoft Defender XDR. It uses PowerShell 7 and the Microsoft Graph security API, including runHuntingQuery .

Repo: defender-xdr-powershell-toolkit

The problem it solves

The Defender portal is great for one incident. It is less great for reports, trends or running the same hunt every week.

You also want to know which devices are not onboarded to Defender for Endpoint. Gaps there are blind spots.

These scripts pull that data to CSV so you can track it.

Highlight scripts

Invoke-AdvancedHuntingQuery.ps1

Runs an advanced hunting KQL query and exports the results. The repo has a small KQL library, like encoded PowerShell, password spray and new forwarding rules.

. / Invoke - AdvancedHuntingQuery . ps1 - QueryFile . . / . . / hunting / queries / encoded - powershell . kql .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.