IT Automation
Small automations for everyday IT administration with PowerShell, Python, Microsoft Graph and n8n. Lab examples, not production deployments.
- Status: Planned
- Lab project
- Concept
Overview
- Report of non-compliant Intune devices (PowerShell + Microsoft Graph).
- Stale device report: devices with no Intune check-in for N days.
- n8n workflow that posts a daily summary of the reports to a chat channel.
- Python script calling the Graph REST API directly, to understand what the SDK does underneath.
Example script
Connect-MgGraph -Scopes "DeviceManagementManagedDevices.Read.All"
Get-MgDeviceManagementManagedDevice -All -Filter "complianceState eq 'noncompliant'" |
Select-Object DeviceName, UserPrincipalName, OperatingSystem, ComplianceState, LastSyncDateTime |
Sort-Object LastSyncDateTime |
Export-Csv -Path .\noncompliant-devices.csv -NoTypeInformation -Encoding UTF8Security considerations
- Read-only Graph scopes for reporting scripts.
- Unattended runs use an app registration with certificate authentication, never a stored password.