agentleFS
MicrosoftKnown publishermicrosoft/mggraph-intune-samples/AGENTS.md

mggraph-intune-samples

AGENTS.md279 starsChanged 5 months agoMITView on GitHub

Guidance for AI coding agents and human contributors working in this repository. mggraph-intune-samples is a collection of sample PowerShell scripts that show how to use the Microsoft Graph PowerShell SDK to manage Microsoft Intune (device configuration, compliance, app protection, enrollment, managed devices, reporting, and more). It is a non-production, learning/reference repository: the scripts are meant to be read, adapted, and run by IT pros against their own tenants. It produces no build artifact and is not a dependency of other…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every .ps1 file starts with the standard .COPYRIGHT header block.

    line 38
  2. Distinctive:

    Prefer clarity over cleverness — these are teaching samples.

    line 41
  3. Distinctive:

    Run the verification loop before committing or opening a PR:

    line 57
  4. Distinctive:

    Keep PRs small and focused — ideally one sample or fix per PR.

    line 68
  5. Very specific:

    Ensure ./scripts/verify.ps1 passes and new scripts include the copyright header.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md

AGENTS.md

Guidance for AI coding agents and human contributors working in this repository.

What this repo is

mggraph-intune-samples is a collection of sample PowerShell scripts that show how to use the Microsoft Graph PowerShell SDK to manage Microsoft Intune (device configuration, compliance, app protection, enrollment, managed devices, reporting, and more). It is a non-production, learning/reference repository: the scripts are meant to be read, adapted, and run by IT pros against their own tenants. It produces no build artifact and is not a dependency of other software.

Repository layout

Each top-level folder groups samples by Intune workload, for example:

FolderArea
AndroidEnterprise/, AOSPEnrollmentProfileManagement/Android enrollment
AppleEnrollment/Apple ADE / APNs
AppConfigurationPolicy/, AppProtectionPolicy/App configuration & protection (MAM)
CompliancePolicy/, DeviceConfiguration/, SettingsCatalog/Policy management
LOB_Application/Line-of-business app upload (Win32 / MSIX / iOS / macOS)
ManagedDevices/Device queries and actions
ReportExportJobs/Intune report export jobs
Permission_Analyzer/Graph permission analysis
docs/Contributor conventions and testing patterns
scripts/Repository tooling (e.g., verify.ps1)

Most folders contain their own README/readme.md describing the samples.

Conventions

See docs/conventions.md for the full coding conventions. Key points:

  • Every .ps1 file starts with the standard .COPYRIGHT header block.
  • Scripts import the specific Microsoft.Graph* submodule(s) they need and use the documented authentication/region pattern.
  • Prefer clarity over cleverness — these are teaching samples.

Safety rules (important)

[!IMPORTANT] Scripts in this repo create, modify, or delete Intune configuration and can affect real devices and users. When authoring or testing:

  • Only run against a non-production ("test") tenant.
  • Never hard-code secrets, tenant IDs, or credentials; never commit exported tenant data (see .gitignore).
  • Keep destructive samples (*_Remove.ps1, *_Wipe.ps1, *_Delete.ps1) clearly scoped and documented.

Verify your changes

Run the verification loop before committing or opening a PR:

./scripts/verify.ps1

This runs PSScriptAnalyzer across all scripts and checks that every .ps1 file has the required copyright header.

Pull requests

  • Keep PRs small and focused — ideally one sample or fix per PR.
  • Fill in the PR template.
  • Ensure ./scripts/verify.ps1 passes and new scripts include the copyright header.
  • See CONTRIBUTING.md for the CLA and full process.

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.