Microsoft 365 Certified: Endpoint Administrator (MD-102) · chapter 12 of 12
Month 6: Robots, reports and Ranger
In this chapter Objectives 5.1, 5.2
Objective 5.1
Automating Intune with PowerShell and Microsoft Graph
Microsoft Graph PowerShell
The Intune admin center talks to Microsoft Graph, and so can you. Install the Microsoft Graph PowerShell SDK (Install-Module Microsoft.Graph), sign in with Connect-MgGraph and only the scopes (permissions) you need, then use cmdlets like Get-MgDeviceManagementManagedDevice to read devices.
Connect-MgGraph -Scopes ` "DeviceManagementManagedDevices.Read.All" $f = "complianceState eq 'noncompliant'" Get-MgDeviceManagementManagedDevice ` -Filter $f | Select-Object DeviceName, UserPrincipalName
Exam tip Least privilege applies to scripts too: Read.All to report, ReadWrite.All only when the script changes things.
Unattended automation
A Monday report shouldn't depend on someone signing in. Register an app in Microsoft Entra ID, grant it application permissions (for example DeviceManagementManagedDevices.Read.All) with admin consent, and authenticate with a certificate. Run it from Azure Automation or a scheduled task. Device actions work too, such as Sync-MgDeviceManagementManagedDevice.
Exam tip If multi admin approval protects a resource, Graph calls that change it also wait for approval, scripts included.
Extending compliance with PowerShell
Custom compliance checks things built-in settings can't. Upload a discovery script (PowerShell for Windows) under Endpoint security > Device compliance > Scripts. It must return its findings as one line of compressed JSON (end with return $hash | ConvertTo-Json -Compress). Add a JSON rules file to a compliance policy: SettingName, Operator (IsEquals, GreaterEquals...), DataType, Operand, and remediation strings users see.
Script returns: {"LabelSvc":"Running"}
JSON rule:
SettingName LabelSvc
Operator IsEquals
DataType String
Operand RunningExam tip One discovery script per compliance policy, but one script can check many settings. Errors 65007-65010 point at script or JSON problems.
Objective 5.1
Security Copilot agents in Intune
The Intune agents
Security Copilot agents run in the Intune admin center under Agents. The one still offered is the Vulnerability Remediation Agent (preview): it uses Microsoft Defender Vulnerability Management data to list CVEs on your devices, ranked by risk, with step-by-step Intune fixes. Microsoft removed the Device Offboarding Agent on June 1, 2026 and retired the Change Review and Policy Configuration Agents on August 31, 2026.
Exam tip Needs Intune Plan 1, Security Copilot capacity (SCUs) and Defender Vulnerability Management. A new instance runs as its own Entra agent identity with only the permissions you delegate.
Investigating what an agent finds
Open a Vulnerability Remediation Agent suggestion: affected devices, the number of CVEs, impact summary and suggested actions. Verify in the Defender portal, fix through Intune (an update ring, app update or setting), then mark it applied so the next run tracks progress. For device performance, Copilot in Intune can summarize a device and explain Endpoint analytics data; you confirm in the reports.
Exam tip Treat agent output as a well-researched recommendation, not an order. You decide, then the agent records what you did.
Responding to recommendations
Agents observe, reason and recommend; they don't change devices on their own. Review each suggestion, check it against your own data, decide, then act with normal Intune tools, where Multi Admin Approval still applies. With the Change Review Agent retired, approvers judge Multi Admin Approval requests themselves from the script, the business justification and the audit log.
Exam tip Older study notes still list four Intune agents. Trust the current Agents node: retired agents aren't a right answer for new work.
Objective 5.2
Endpoint analytics and Remediations
Endpoint analytics scores
Endpoint analytics scores the user experience from 0 to 100. Startup performance: boot and sign-in times, startup apps that slow sign-in, restart frequency and blue screens. Application reliability: app crashes and mean time to failure. Work from anywhere: readiness for cloud management. Compare against a baseline (the all-organizations median or your own saved one); scores below the baseline by the threshold show as regressions.
Exam tip "Laptops got slower after last month's change" = compare startup scores with the baseline, then open the device to see what's slow.
Remediations
Devices > Scripts and remediations > Remediations: a script package holds a detection script and a remediation script. The remediation runs only when detection exits with exit 1 (issue found). Schedule it Once, Hourly or Daily, choose system or logged-on credentials and 64-bit PowerShell, and assign to device groups. Run remediation runs a package on one device on demand. Remediations need Windows Enterprise E3/E5 or similar licenses.
Detect_Spooler.ps1
$s = Get-Service Spooler
if ($s.Status -ne 'Running') {
Write-Output "Spooler stopped"
exit 1 }
exit 0
Remediate_Spooler.ps1
Start-Service SpoolerExam tip Status words: Without issues, With issues, Issue fixed, Issue recurred, Failed. Output is capped at 2,048 characters.
Objective 5.2
Reports, tenant health and alerts
Intune reports
Intune reports come in kinds: operational (near real time, act now: noncompliant devices, app install status), organizational (broad summaries), historical (trends) and specialist (Azure Monitor). Most let you choose columns, filter, search and export to CSV. The Intune Data Warehouse offers an OData feed for Power BI dashboards.
Exam tip "Send compliance data to a dashboard the whole team can edit" = diagnostic settings to Log Analytics, then a workbook.
Log Analytics, workbooks and alerts
In Reports > Diagnostic settings, send AuditLogs, OperationalLogs, DeviceComplianceOrg and IntuneDevices to a Log Analytics workspace (needs an Azure subscription). Then build workbooks and dashboards, and create Azure Monitor alert rules with action groups: email when compliance drops (drift), when enrollment failures spike, or when audit logs show policy changes. Conflicts show in each profile's status report.
Exam tip Audit logs answer "who changed this policy and when". Operational logs answer "which enrollments failed".
Tenant health and service communications
Tenant administration > Tenant status has three tabs. Tenant details: name, location, MDM authority, service release. Connector status: Apple push certificate, ADE and VPP tokens, Managed Google Play, Defender and more (unhealthy when expired or not synced for 3+ days). Service health and message center: active incidents, issues that need action, and planned changes.
Exam tip Build an operational baseline: normal compliance %, enrollment success and check-in rates. Alerts only work when you know what normal looks like.
Check yourself 1Kibble wants a script to export noncompliant devices every Monday at 6:00 with no one signed in. What should Dev set up?
- Connect-MgGraph signed in as Dev every Monday morning at six
- A compliance policy action that emails the device list
- An app registration with a certificate and app permissions
- A Remediations package scheduled Daily
Show the answer
Answer: C. An app registration with a certificate and app permissions
Unattended Graph automation uses an Entra app registration with application permissions and certificate authentication, run on a schedule.
Check yourself 2Mr. Barkley wants an email when the share of compliant devices drops sharply. What's the best Intune-based approach?
- Ask Rosa to check the compliance report every hour
- Compliance logs to Log Analytics, plus an alert rule
- Add Send email to end user to every compliance policy
- Turn on the Vulnerability Remediation Agent
Show the answer
Answer: B. Compliance logs to Log Analytics, plus an alert rule
Diagnostic settings send compliance logs to Log Analytics, where an Azure Monitor alert rule can email an action group when compliance drops.
Go deeper
More on the objectives in this chapter, in the same exam-ready detail.
Objective 5.1 · Investigate threats identified by Security Copilot agents in Intune
Security Copilot agents: reviewing what they find
The agents in Intune
Security Copilot agents run inside the Intune admin center (Agents node) and work under admin oversight. They use security compute units (SCUs) from Security Copilot.
- Vulnerability Remediation Agent: reads Microsoft Defender vulnerability data and lists prioritized fixes
- Change Review Agent: evaluates Multi Admin Approval requests for Windows PowerShell scripts and recommends approve or reject
- Device Offboarding Agent: finds stale or mismatched devices in Intune and Entra ID; nothing is removed without approval
- Policy Configuration Agent: turns a document or plain-language request into settings catalog values
Exam tip Microsoft announced retirements for three of these: the Device Offboarding Agent on June 1, 2026, and the Policy Configuration and Change Review agents on August 31, 2026 (see each agent's Learn page). The Vulnerability Remediation Agent has no retirement notice, so it's the one to know best.
Investigating a finding
The Vulnerability Remediation Agent shows a prioritized list of suggestions (ranked by CVSS score, exposure and how many devices). Open one to see the number of CVEs, a summary of the impact, affected and exposed devices, and step-by-step remediation in Intune (for example deploy an app update or a configuration policy). After fixing it, mark it applied so later runs show how the risk changed.
- Needs Intune Plan 1, Security Copilot with SCUs, and Defender Vulnerability Management (Defender for Endpoint P2 or the standalone add-on)
- An admin starts runs (or schedules them) after a readiness check
- Windows client devices only for CVE counts
Exam tip Agents recommend; admins approve and act. A question that has the agent 'automatically wiping devices' is wrong.
Objective 5.2 · Implement reporting and data visibility in Microsoft Intune, including customizing reports and filters…
Intune reports, workbooks and exports
Built-in reports
In Reports you'll find operational reports (for example noncompliant devices, app install status), organizational reports (device compliance, device configuration) and historical/trend reports. Most reports let you filter columns (OS, ownership, compliance state), search, sort, choose columns, and Export to a .csv (zipped) file.
Exam tip If a report is missing new data, select Generate (or Generate again): many reports are snapshots, not live.
Workbooks and dashboards
Turn on Diagnostic settings in Tenant administration to stream Intune logs (AuditLogs, OperationalLogs, DeviceComplianceOrg, Devices) to an Azure Log Analytics workspace. Then use Reports > Log analytics workbooks (or build your own with KQL), and pin charts to an Azure dashboard.
- Audit logs: who changed what in Intune
- Operational logs: enrollment successes and failures
- Data kept as long as the workspace's retention setting
Exporting data
For automation, call the Microsoft Graph exportJobs API: POST a job to deviceManagement/reports/exportJobs with the report name, filters and format (csv or json), poll until the status is completed, then download the zip from the returned URL. Power BI can also read the Intune Data Warehouse.
Exam tip Need history beyond what the console shows, or a custom chart: Log Analytics. Need a one-time spreadsheet: Export. Need a scheduled feed into another tool: Graph exportJobs.
Practice questions
Answer in your head, then open the answer. Ranger's Desktop Duty has 374 questions like these for MD-102, with mock exams.
Question 1Dev is writing a PowerShell script that only lists Kibble's Intune-managed devices for a weekly report. Which command connects with the least privilege the task needs?
- Connect-AzureAD -Scopes Device.Read.All
- Connect-MgGraph -Scopes Directory.ReadWrite.All
- Connect-MgGraph -Scopes DeviceManagementManagedDevices.Read.All
- Connect-MgGraph -Scopes DeviceManagementManagedDevices.ReadWrite.All
Show the answer
Answer: C. Connect-MgGraph -Scopes DeviceManagementManagedDevices.Read.All
Microsoft Graph PowerShell signs in with Connect-MgGraph and requested scopes. Reading managed devices needs only DeviceManagementManagedDevices.Read.All.
Question 2Dev's script must force a sync on 50 Kibble laptops with Sync-MgDeviceManagementManagedDevice. Which Microsoft Graph permission does the cmdlet require?
- DeviceManagementManagedDevices.Read.All
- DeviceManagementManagedDevices.PrivilegedOperations.All
- DeviceManagementApps.ReadWrite.All
- DeviceManagementConfiguration.ReadWrite.All
Show the answer
Answer: B. DeviceManagementManagedDevices.PrivilegedOperations.All
Remote actions such as syncDevice need DeviceManagementManagedDevices.PrivilegedOperations.All, for both delegated and application permissions.
Question 3Dev needs a Kibble device property that is exposed only in the Microsoft Graph beta endpoint. Which cmdlet should his script use to list managed devices?
- Get-MgBetaDeviceManagementManagedDevice
- Get-MgDeviceManagementManagedDevice
- Get-MgDevice
- Get-IntuneManagedDevice
Show the answer
Answer: A. Get-MgBetaDeviceManagementManagedDevice
Microsoft Graph PowerShell has v1.0 cmdlets (Get-MgDeviceManagementManagedDevice) and beta cmdlets in the Microsoft.Graph.Beta modules (Get-MgBetaDeviceManagementManagedDevice). Microsoft recommends v1.0 when it has what you need.
Question 4Dev wants to call an Intune Graph endpoint that has no matching Microsoft Graph PowerShell cmdlet yet, while reusing his Connect-MgGraph session. What should he use?
- Get-MgContext
- Invoke-WebRequest with no token
- Import-Module AzureAD
- Invoke-MgGraphRequest
Show the answer
Answer: D. Invoke-MgGraphRequest
Invoke-MgGraphRequest sends a REST call to any Microsoft Graph URI using the signed-in Microsoft Graph PowerShell session.
Question 5Kibble wants a nightly scheduled script to export Intune device data with no one signed in. What kind of authentication should Dev set up?
- A shared admin account with the password in the script
- App-only access: app registration + certificate
- Device code flow each night
- Delegated permissions with Dev's own account
Show the answer
Answer: B. App-only access: app registration + certificate
Unattended automation uses an app registration (service principal) granted application permissions, ideally authenticating with a certificate or managed identity instead of a stored secret.
Microsoft, Azure, Intune and Windows are trademarks of the Microsoft group of companies. Ranger Gamez is not affiliated with or endorsed by Microsoft. The practice questions are written to the published exam objectives; they are not real exam questions.