How to Monitor Device Actions and Audit Logs in Microsoft Intune (Step-by-Step Guide)
Part 1: View Device Actions
Goal: Find who ran an action (e.g. Wipe) on a device and when.
- Sign in to the Microsoft Intune admin center.
- Go to Devices → Overview.
- Click the Device actions box.
- Review the list — it shows the action taken, date/time, and who triggered it across all platforms.[learn.microsoft]
- Use the Filter option to narrow by action type (e.g. Wipe, Sync, Restart).
- Click Export if you need the data for an incident report.
Note: There is no search bar and you cannot sort columns in the UI. Use the PowerShell script below to get sortable output.
PowerShell — Export Device Actions:
powershell$exportpath = "c:\temp\deviceactions.csv"
$url = "https://graph.microsoft.com/beta/deviceManagement/remoteActionAudits"
$fulloutput = getallpagination -url $url
$fulloutput | Select-Object * | Export-Csv $exportpath -NoTypeInformation
The API returns only 25 entries by default, so pagination is required.learn.microsoft+1
Part 2: Set Up Device Query
Goal: Configure Intune to collect real-time device properties you can query with KQL.
- Go to Devices → Windows → Configuration.
- Click Create → New Policy.
- Set Platform to
Windows 10 and later. - Set Profile type to
Properties catalog. - Click Create.
- Give the policy a Name and Description, then click Next.
- Click Add properties and select the properties you need (e.g. CPU, TPM, OS version).learn.microsoft+1
- Click Next through Scope Tags.
- Assign the policy to All Devices or a specific group, then click Next.
- Review and click Create.
Important: Wait at least 24 hours after policy assignment before data starts appearing in Device query.
Device query requires an Intune Advanced Analytics license (part of Intune Suite).
Part 3: Run a Device Query
Multiple Devices
- Go to Devices → Device query.
- On the left panel, browse available properties or type a KQL query directly in the text box.[niklasrast]
- Click Run.
- Results appear below. Click Export if needed.
Single Device (Live Data)
- Go to Devices → All devices and select a device.
- Click Device query.
- Enter your KQL query (or use an example from the bottom of the panel).
- Click Run and check the Results tab.
Example KQL query:
textDeviceInfo
| project DeviceName, OSVersion, TotalMemory
Learn KQL basics at: https://learn.microsoft.com/en-us/azure/data-explorer/kql-learning-resources
Part 4: Review Audit Logs
Goal: Track tenant-level changes like policy edits, creations, or deletions.learn.microsoft+1
- Go to Tenant administration → Audit logs.
- Use the Filter at the top to narrow by activity type, date range, or category.
- Use the Search box to find changes made by a specific user (enter their UPN).
- Click any row to see full details — including old value and new value of what changed.controlaltdeletetechbits+1
- Click Export to download what is currently shown on screen.
Tip: The export only captures what’s visible on screen. Use the Graph API script below to pull full details including modified property values.
PowerShell — Export Audit Logs with Drill-Down:
powershell$exportpath = "c:\temp\auditlog.csv"
$uri = "https://graph.microsoft.com/beta/deviceManagement/auditEvents"
# Get all paginated results and expand the Actor object
$eventsvalues = getallpagination -url $uri
$eventsvalues = $eventsvalues | Select-Object * -ExpandProperty Actor
$eventsvalues = $eventsvalues | Select-Object resources, userPrincipalName,
displayName, category, activityType, activityDateTime,
activityOperationType, id
# Build clean output array
$listofevents = foreach ($event in $eventsvalues) {
[pscustomobject]@{
changedItem = $event.Resources.displayName
changedBy = $event.userPrincipalName
change = $event.displayName
changeCategory = $event.category
activityType = $event.activityType
activityDateTime = $event.activityDateTime
id = $event.id
}
}
# Export or view
$listofevents | Export-Csv $exportpath -NoTypeInformation
# OR for interactive grid with drill-down:
$selected = $listofevents | Out-GridView -PassThru
Audit logs via Graph API retain up to 2 years of data.[learn.microsoft]
Quick Reference
| Feature | Location in Portal | Graph Endpoint |
|---|
| Feature | Location in Portal | Graph Endpoint |
|---|---|---|
| Device actions | Devices → Overview → Device actions | /deviceManagement/remoteActionAudits [learn.microsoft] |
| Device query (multi) | Devices → Device query | API currently locked |
| Device query (single) | Devices → [Device] → Device query | API currently locked |
| Audit logs | Tenant administration → Audit logs | /deviceManagement/auditEvents [learn.microsoft] |
