agentleFS
soulemikesoulemike/microsoft-skills/skills/intune/SKILL.md

intune

Skill2 starsChanged 3 months agoMITView on GitHub

Use this skill for Microsoft Intune device and configuration policy retrieval through Microsoft Graph, including per-item enrichment and beta-only policy surfaces.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. crtvrffnrt/skills★ 5same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository13 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when an agent needs Intune data through Microsoft Graph, especially when list endpoints return incomplete objects.

    line 22
  2. Distinctive:

    Prefer managed identity or federated credentials over client secrets.

    line 68
  3. Distinctive:

    Treat beta endpoints as change-prone and validate them before using them in production automations.

    line 70
  4. Distinctive:

    When collection endpoints return incomplete objects, it uses per-item GET enrichment and child-endpoint lookups.

    line 75
  5. Distinctive:

    Use the beta endpoint explicitly for modern Intune policy surfaces

    line 176

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Intune / Endpoint Manager Skill

Agent Summary

Use this skill when an agent needs Intune data through Microsoft Graph, especially when list endpoints return incomplete objects. The usual pattern is to authenticate with ./skills/graph/Connect-GraphApi.ps1, list lightweight objects first, then perform per-item GETs or child-endpoint queries for full detail.

When to Use

  • List Intune managed devices and enrich sparse properties.
  • Retrieve classic device configuration or compliance policies.
  • Access beta-only settings catalog or configuration policy endpoints.

Required Parameters

Get-IntuneDevice.ps1

ParameterTypeRequiredNotes
AuthContexthashtableYesGraph auth context from Connect-GraphApi.ps1.
DeviceIdstringNoWhen present, retrieves one managed device.
Selectstring[]NoUse this for per-device enrichment; hardwareInformation forces beta.

Get-IntuneConfigurationPolicy.ps1

ParameterTypeRequiredNotes
AuthContexthashtableYesGraph auth context from Connect-GraphApi.ps1.
PolicyTypestringNodeviceConfiguration, deviceCompliance, or configurationPolicy; defaults to deviceConfiguration.
PolicyIdstringNoRetrieve one policy instead of listing.
IncludeSettingsswitchNoValid only for configurationPolicy.
IncludeAssignmentsswitchNoRetrieves /assignments child data.

Invoke-IntuneGraphRequest.ps1

ParameterTypeRequiredNotes
UristringYesIntune-relative path or absolute Graph nextLink URL.
AuthContexthashtableYesGraph auth context.
ApiVersionstringNov1.0 or beta; defaults to v1.0.
MethodstringNoDefaults to GET.
BodyobjectNoRequest payload for writes.

Example Agent Prompts

  • "List all Intune managed devices and then enrich each device with hardware information."
  • "Retrieve all Intune configuration policies including settings and assignments."
  • "Use the beta Intune endpoint for settings catalog policies."

Example Agent Workflow

$ctx = ./skills/graph/Connect-GraphApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud

$devices = ./skills/intune/Get-IntuneDevice.ps1 -AuthContext $ctx -Select @('id','deviceName','operatingSystem')

Security Caveats

  • Prefer managed identity or federated credentials over client secrets.
  • Request only the Graph application permissions needed for the exact Intune surface you are querying.
  • Treat beta endpoints as change-prone and validate them before using them in production automations.

Overview

This skill package uses Microsoft Graph to read Intune managed devices and retrieve Intune policy configuration details.

When collection endpoints return incomplete objects, it uses per-item GET enrichment and child-endpoint lookups.

Authentication

  • Graph token
  • v1.0 for classic operations
  • beta required for modern operations

Endpoints

Uses Graph endpoint from environment.

Skills

FilePurpose
Get-IntuneDevice.ps1Lists Intune managed devices and, when needed, enriches per-device fields via item GET and $select
Get-IntuneConfigurationPolicy.ps1Retrieves Intune device configuration policies, classic policies, and modern configuration policy settings via beta child endpoints
Invoke-IntuneGraphRequest.ps1Intune-aware Graph REST wrapper, supporting v1.0 and beta, with automatic pagination for GETs

Toolchain

ServiceToolBest ForGraph VersionLimitations
TeamsMicrosoft.Graph SDK (Get-MgTeam, Get-MgTeamChannel)Team/channel lifecycle, messages, tabs, appsv1.0Large module footprint; some operations require Group.ReadWrite.All
TeamsRaw REST (Invoke-MgGraphRequest)Direct control over Teams endpointsv1.0 / betaCaller must handle pagination and throttling
TeamsPnP CLI (m365 teams)Cross-platform Teams admin scriptingv1.0Community-driven; no Microsoft SLA
IntuneMicrosoft.Graph SDK (Get-MgDeviceManagementDeviceConfiguration)Classic device configuration, compliance policies, managed devicesv1.0Settings catalog and modern policies not in v1.0
IntuneRaw REST (this toolkit)Direct access to any Intune endpoint via Invoke-IntuneGraphRequest.ps1v1.0 / betaMust explicitly target -ApiVersion beta for modern policy operations; caller handles pagination and throttling

Patterns & Caveats

List vs Get Is Not Symmetric

The list response returns default, null, or empty values for several properties. A per-device GET /{id} with $select is required to retrieve true values.

PropertyList BehaviorPer-Device GET Required
activationLockBypassCodenullYes, with $select
hardwareInformationOmitted / defaultYes, with $select (beta)
notesnullYes, with $select
iccidEmpty stringYes, with $select
udidEmpty stringYes, with $select
ethernetMacAddressnull / defaultYes, with $select
physicalMemoryInBytes0Yes, with $select
remoteAssistanceSessionUrlEmpty stringYes, with $select

Recommended Pattern

# 1. List to get IDs
$devices = Invoke-GraphRequest -Uri "deviceManagement/managedDevices?`$select=id,deviceName,operatingSystem"

# 2. Iterate and enrich per device
foreach ($device in $devices.value) {
    $detail = Invoke-GraphRequest -Uri "deviceManagement/managedDevices/$($device.id)?`$select=id,activationLockBypassCode,hardwareInformation,notes"
}

$select mitigates this on item GETs, but does not make collection endpoints return true values for these properties.

Beta-Required Capabilities

  • Settings catalog
  • Assignment filters
  • Reusable settings
  • Device health scripts

Policy Detail Lives in Child Endpoints

Policy list responses contain the policy object metadata, but operational detail lives in child endpoints. This is a related collection pattern rather than a sparse-item pattern.

Endpoint TypeList ReturnsChild Endpoints for Detail
deviceConfigurationsPolicy metadata (id, displayName, platform, version)/{id}/assignments, /{id}/deviceStatuses, /{id}/getOmaSettingPlainTextValue(...)
deviceCompliancePoliciesPolicy metadata/{id}/assignments, /{id}/scheduledActionsForRule, /{id}/scheduledActionsForRule/{ruleId}/scheduledActionConfigurations
configurationPolicies (beta)Policy metadata (id, name, settingCount, templateReference)/{id}/settings, /{id}/settings?$expand=settingDefinitions, /{id}/assignments

Recommended Pattern

# 1. List policies
$policies = Invoke-GraphRequest -Uri "deviceManagement/configurationPolicies"

# 2. Per policy, fetch settings and assignments
foreach ($policy in $policies.value) {
    $settings = Invoke-GraphRequest -Uri "deviceManagement/configurationPolicies/$($policy.id)/settings?`$expand=settingDefinitions"
    $assignments = Invoke-GraphRequest -Uri "deviceManagement/configurationPolicies/$($policy.id)/assignments"
}

Key Takeaway: $expand is not a universal fix. For managed devices, use $select on per-item GETs. For policies, follow child endpoints. Always paginate both list and child collection calls.

Examples

  1. List+enrich managed device details (use item GET for sparse fields)
$context = Connect-GraphApi -AuthenticationType ManagedIdentity -Environment AzureCloud

# 1. List with a lightweight projection
$devices = Get-IntuneDevice -AuthContext $context -Select @('id','deviceName','operatingSystem')

# 2. Enrich per device
foreach ($d in $devices) {
    $detail = Get-IntuneDevice -AuthContext $context -DeviceId $d.id -Select @('id','activationLockBypassCode','hardwareInformation','notes')
    $detail
}
  1. Use the beta endpoint explicitly for modern Intune policy surfaces
$context = Connect-GraphApi -AuthenticationType ManagedIdentity -Environment AzureCloud

# Beta is required for modern configuration policies and settings catalog surfaces
$configurationPolicies = Invoke-IntuneGraphRequest -AuthContext $context -Uri '/configurationPolicies' -ApiVersion beta
$configurationPolicies
  1. Retrieve policy settings via child endpoints (/settings) and include assignments
$context = Connect-GraphApi -AuthenticationType ManagedIdentity -Environment AzureCloud

$policies = Get-IntuneConfigurationPolicy -AuthContext $context -PolicyType configurationPolicy -IncludeSettings -IncludeAssignments
$policies[0].settings
$policies[0].assignments

Prerequisites

  • Required modules
    • PowerShell 7.2+
    • Microsoft.Graph.Authentication, Microsoft.Graph.DeviceManagement (installed by ./prerequisites/Install-RequiredModules.ps1)
    • MSAL.PS only if using certificate authentication
  • Required permissions
    • Managed devices: DeviceManagementManagedDevices.Read.All (or DeviceManagementManagedDevices.ReadWrite.All)
    • Configuration and settings catalog: DeviceManagementConfiguration.Read.All (or DeviceManagementConfiguration.ReadWrite.All), plus DeviceManagementEndpointSecurity.Read.All (or DeviceManagementEndpointSecurity.ReadWrite.All) when required by the endpoint
    • Device health scripts: DeviceManagementScripts.Read.All (or DeviceManagementScripts.ReadWrite.All)

Community Resources

IntuneAutomation

IntuneAutomation is an open-source Intune PowerShell script library maintained by UgurLabs. It provides 60 production-ready scripts covering devices, compliance, apps, security, reporting, operational tasks, configuration, monitoring, diagnostics, notification, and remediation.

AttributeDetail
LicenseMIT
ValidationPSScriptAnalyzer in CI
Execution modesLocal PowerShell or Azure Automation runbook
Auth methodInteractive or app-only via Invoke-MgGraphRequest
Graph versionv1.0 and beta

Relationship to this skill: IntuneAutomation is a complementary domain-specific script library, not a competitor. It offers breadth (60 ready-to-run scripts) without the cross-service auth governance, secret management, or multi-tenant isolation patterns this toolkit enforces. Teams using this toolkit for auth governance can port IntuneAutomation scripts into the normalized parameter set by replacing their auth blocks with Connect-GraphApi.ps1 and their REST calls with Invoke-IntuneGraphRequest.ps1.

Companion tools from the same maintainer:

  • IntuneBrew — macOS app packaging and deployment via Homebrew
  • IntuneGet — Windows app packaging and deployment automation
  • TenuVault — Tenant-level backup and restore for Intune policies, profiles, and apps

Related Docs

  • Auth Patterns
  • Patterns and Caveats
  • Environment Endpoints

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.