azureblog.co.uk
← MD-102 study plan
MD-102 · Optimize endpoint operations by using automation, monitoring, and reporting

Automate Intune management tasks

PowerShell and Microsoft Graph for Intune, Security Copilot agents in Intune, and custom compliance with PowerShell.

  • 15 min
  • 5 concepts
  • Try it yourself
  • 4-question check

Learn

Everything in the Intune admin center is a Microsoft Graph call underneath, so it can be scripted. Security Copilot agents add AI that watches your estate and recommends actions for you to approve.

  1. 1

    Automate Intune management tasks by using PowerShell and Microsoft Graph

    Use the Microsoft Graph PowerShell SDK (Connect-MgGraph -Scopes DeviceManagementManagedDevices.ReadWrite.All, then cmdlets such as Get-MgDeviceManagementManagedDevice) or call Graph REST at /deviceManagement. For unattended automation, use an app registration with a certificate, or a managed identity in Azure Automation, with only the permissions needed. Graph Explorer helps discover calls.

    Remember: Admin center actions are Graph calls you can script.

  2. 2

    Investigate threats identified by Security Copilot agents in Intune

    The Vulnerability Remediation Agent uses Defender data to find vulnerabilities on managed devices, prioritise them by risk, and suggest Intune remediation steps such as an app update or a configuration change. Review its findings and reasoning before acting.

    Remember: Vulnerability Remediation Agent: prioritised fixes from Defender data.

  3. 3

    Analyze device performance by using Security Copilot agents in Intune

    Copilot in Intune can summarise and explore device data in natural language: device details, compliance, apps and hardware. Agents such as the Device Offboarding Agent find stale or misaligned devices across Intune and Entra ID. Combine with Endpoint analytics for performance scores.

    Remember: Ask Copilot about a device in plain English.

  4. 4

    Review and respond to Security Copilot agent recommendations to make management decisions

    Agents recommend, admins decide. The Change Review Agent evaluates multi admin approval requests and recommends approve or reject. The Policy Configuration Agent turns documents or plain-language requirements into settings catalog values. The Device Offboarding Agent requires admin approval before offboarding. Agents use Security Compute Units and need Security Copilot enabled.

    Remember: Agents need approval; they don't act alone.

  5. 5

    Extend device compliance by using PowerShell

    Custom compliance for Windows uses a PowerShell discovery script that returns JSON values from the device, and a JSON rules file that defines expected values (with operators and remediation text) in the compliance policy. Use it for checks built-in compliance doesn't cover, such as a specific agent running.

    Remember: Discovery script + JSON rules = custom compliance.

Security Copilot agents in Intune

AgentWhat it does
Vulnerability RemediationPrioritises vulnerabilities from Defender data and suggests fixes
Change ReviewEvaluates approval requests and recommends actions
Policy ConfigurationTurns requirements into settings catalog values
Device OffboardingFinds stale devices; offboards only with approval

Try it

Click each line of this Graph PowerShell script that lists noncompliant Windows devices.

This interactive part needs JavaScript.

In the portal

  • Custom compliance scriptsIntune admin center: Devices > Compliance > Scripts
  • AgentsIntune admin center: Agents
  • Graph ExplorerIntune admin center: developer.microsoft.com/graph/graph-explorer

Key terms

Click a card to see the definition.

Check your understanding

4 questions. Score 80% or more and these skills are marked as confident in your MD-102 study plan.

  1. What two parts make up Windows custom compliance?

  2. Which agent evaluates multi admin approval requests?

  3. What does Connect-MgGraph -Scopes do?

  4. Do Intune agents offboard devices without asking?

Sources

Facts in this lesson are from Microsoft Learn. This site isn't affiliated with Microsoft.