|
| 1 | +# MDM Check-in Monitor |
| 2 | + |
| 3 | +## Overview |
| 4 | +Real-time monitoring tool that detects and displays Microsoft Intune MDM check-in events on macOS by streaming unified log entries from the `mdmclient` process. |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | +- macOS device enrolled in Microsoft Intune |
| 8 | +- Terminal access |
| 9 | +- Root/sudo privileges (required for log streaming) |
| 10 | + |
| 11 | +## Usage |
| 12 | +1. Navigate to the tool directory: |
| 13 | + ```bash |
| 14 | + cd macOS/Tools/mdmCheckinMonitor |
| 15 | + ``` |
| 16 | + |
| 17 | +2. Make the script executable (if needed): |
| 18 | + ```bash |
| 19 | + chmod +x monitorMdmCheckin.zsh |
| 20 | + ``` |
| 21 | + |
| 22 | +3. Run the monitor with sudo: |
| 23 | + ```bash |
| 24 | + sudo ./monitorMdmCheckin.zsh |
| 25 | + ``` |
| 26 | + |
| 27 | +4. The script will continuously monitor for MDM check-in events. Press `Ctrl+C` to stop monitoring. |
| 28 | + |
| 29 | +## What it monitors |
| 30 | +The script watches for MDM client check-in events by filtering the unified log stream for: |
| 31 | +- Process: `mdmclient` |
| 32 | +- Event type: DeclarativeManagement requests for Device context |
| 33 | +- Message pattern: `"Processing server request: DeclarativeManagement for"` containing `"<Device>"` |
| 34 | + |
| 35 | +## Output |
| 36 | +When an MDM check-in is detected, the script displays: |
| 37 | +- Timestamp of detection |
| 38 | +- Full log entry from `mdmclient` |
| 39 | +- Separator line for readability |
| 40 | + |
| 41 | +Example output: |
| 42 | +``` |
| 43 | +Monitoring for MDM client check-in events... |
| 44 | +Press Ctrl+C to exit |
| 45 | +
|
| 46 | +[2025-11-04 14:32:15] MDM Check-in detected: |
| 47 | +2025-11-04 14:32:15.123456+0000 0x12345 Info 0x0 mdmclient: Processing server request: DeclarativeManagement for <Device> |
| 48 | +------------------------- |
| 49 | +``` |
| 50 | + |
| 51 | +## Use cases |
| 52 | +- Verify MDM check-in timing and frequency |
| 53 | +- Troubleshoot MDM communication issues |
| 54 | +- Monitor device management activity in real-time |
| 55 | +- Correlate MDM events with other system behavior |
| 56 | + |
| 57 | +## Notes |
| 58 | +- The script runs continuously until manually stopped with `Ctrl+C` |
| 59 | +- This is a monitoring-only tool and takes no actions on the system |
| 60 | +- Log streaming may show a brief "Filtering the log data..." header at startup (automatically ignored) |
0 commit comments