Courseiva

MD-102 Prepare infrastructure for devices Practice Question

You use Microsoft Intune to manage macOS devices. You need to deploy a shell script that runs on all macOS devices. What is the correct method?

⚠ Common exam trap

Watch out — candidates often confuse the ability to run PowerShell scripts on Windows with macOS, or mistakenly think a configuration profile can execute arbitrary code, when in fact Intune strictly separates script deployment (Devices > Scripts) from configuration profiles (Devices > Configuration profiles).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Add a shell script under Devices > Scripts

In Microsoft Intune, shell scripts for macOS are managed under Devices > Scripts, where you can add a script with a specific shell (e.g., bash, sh, zsh) and configure its execution frequency, run context, and notifications. This is the correct method because Intune natively supports deploying and running shell scripts on macOS devices via the Intune management agent, without requiring additional infrastructure.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Add a shell script under Devices > Scripts

    Why this is correct

    Intune's Devices > Scripts node deploys shell scripts natively to macOS, executing them via the Intune management agent. This satisfies the requirement to run a script across all managed macOS devices without repackaging as an app.

  • ✗

    Use Company Portal to distribute the script

    Why it's wrong here

    Company Portal distributes apps and configuration profiles to users; it cannot execute shell scripts on macOS devices. It is tempting because Company Portal is the user-facing delivery channel, but shell scripts must be assigned through the Intune shell scripts policy for macOS.

  • ✗

    Add a PowerShell script under Devices > Scripts

    Why it's wrong here

    Intune's Scripts blade only supports PowerShell on Windows; macOS shell scripts deploy via the Shell scripts node under Devices > Scripts, which runs Bash or Zsh. PowerShell is tempting because it is the familiar Windows scripting path, and it would be correct for Windows devices.

  • ✗

    Create a custom configuration profile with Bash script

    Why it's wrong here

    Custom configuration profiles carry a property list payload, not executable Bash; Intune deploys macOS shell scripts through the dedicated Shell scripts workload. Configuration profiles are tempting because they deliver settings, and they would be correct for enforcing preferences such as FileVault or Wi-Fi.

About these practice questions

One of 556 original MD-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MD-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MD-102 exam.