GuideInformationBusiness ContinuityIT

Make Intune macOS shell scripts safe for parallel and repeated execution

Can a macOS management script tolerate concurrent runs and the chosen user context?

Governed cloud identity system with connected service and lifecycle nodes.
DSE visual intelligenceIdentity & cloudGuide · 2 min read
Executive summary

What you need to know

Can a macOS management script tolerate concurrent runs and the chosen user context?

Potentially affected

Confirm supported macOS, the installed management agent, and the required shell interpreter. Determine whether the proposed action belongs to the device or to each signed-in user before choosing execution context.

DSE recommendation

Review the script for repeated side effects, shared temporary paths, and assumptions that another script has already finished.

Source facts

Intune runs macOS shell scripts as separate parallel processes. A script configured for signed-in users runs for every currently signed-in account, while the default setting runs as root. Certain conditions can trigger runs more frequently than the selected frequency. Scripts exceeding 60 minutes are stopped and reported failed. Microsoft requires direct internet connectivity; proxy connections are unsupported. Microsoft Learn.

Applicability

Confirm supported macOS, the installed management agent, and the required shell interpreter. Determine whether the proposed action belongs to the device or to each signed-in user before choosing execution context.

DSE recommendation

Review the script for repeated side effects, shared temporary paths, and assumptions that another script has already finished. Require an explicit reason for root execution. Design state checks so an already-correct device needs no further change, and define a clear exit result when a prerequisite is absent. Avoid making one independent assignment a hidden prerequisite for another.

Verification

Rehearse the script on a test Mac with representative account and sign-in conditions. Run the intended operation again and check for duplicate configuration, unintended file changes, or conflicting concurrent activity. Compare the script’s exit result with the actual requested state; a zero exit code alone should not be the team’s acceptance criterion. Keep sanitized local evidence and the reviewed script version with the deployment record.

Official references

Microsoft Learn: Use Shell Scripts on macOS Devices in Microsoft Intune.

Primary reference

Review the official source

Use Shell Scripts on macOS Devices in Microsoft Intune - Microsoft Intune | Microsoft Learn · Verified September 9, 2026

Open official reference ↗
Plan the next step

Need help applying this guidance safely?

DSE can help confirm applicability, protect service continuity, and validate the result across physical security and IT systems.

Talk with DSE