Skip to main content

How to Run Shell Scripts on macOS devices in Intune

In this post, I will show you how to run shell scripts on macOS devices in Intune. You can use shell scripts on macOS devices to extend device management capabilities in Intune.

We all know that you can deploy PowerShell scripts on Windows devices using Intune. Running a shell script on a macOS device is a game changer since these scripts allow you to make complicated changes to your macOS devices. If you have numerous Mac devices in your setup, you may use Intune to mass distribute configuration updates to these devices.

When you create and assign a shell script policy to macOS devices, it is run as a distinct process, and the run status is provided back to Intune, enabling administrators to monitor execution success or error codes. When you set the scripts to run at regular intervals, the scripts are saved locally to save download time.

Note: Rosetta 2 is required to run the x64 (Intel) version of apps on Apple Silicon Macs. To install Rosetta 2 on Apple Silicon Macs automatically, you can deploy a shell script in Endpoint Manager. Also, see how to manage software updates on macOS using Intune.


Prerequisites


The following prerequisites are required to run shell scripts on macOS devices using Intune:


  • The macOS devices must be running version 11.0 or later.
  • You must enroll macOS devices in Intune before you run shell scripts.
  • The macOS devices must be connected directly to the Internet. Connection through a proxy is not supported.
  • You must have a script ready to apply it to macOS devices.
  • Shell scripts begin with #! and must be in a valid location such as #!/bin/sh or #!/usr/bin/env sh.
  • Command-line interpreters for the applicable shells are installed.

https://fofabaike.com/forum.php?mod=viewthread&tid=894

https://fofabaike.com/forum.php?mod=viewthread&tid=513

https://fofabaike.com/forum.php?mod=viewthread&tid=835

https://cartoonani.yju.ac.kr/free/18361

http://www.thesheeplespen.com/chat/viewthread.php?tid=264877

http://www.thesheeplespen.com/chat/viewthread.php?tid=187542

https://www.wolala.love/thread-43243-1-1.html

https://www.101skins.com.tw/forum.php?mod=viewthread&tid=4933057

https://www.101skins.com.tw/forum.php?mod=viewthread&tid=5029876

https://www.101skins.com.tw/forum.php?mod=viewthread&tid=4947508

http://newmoojin.co.kr/bbs/board.php?bo_table=free&wr_id=65770

https://www.my-photo.kr/dragon/bbs/board.php?bo_table=free&wr_id=99539&sst=wr_hit&sod=desc&sop=and&page=3705

http://mystrotain.free.fr/forum/showthread.php?tid=51388


Considerations for using macOS Shell Scripts with Intune


Listed below are important considerations provided by Microsoft before using shell scripts on macOS devices using Intune:


  • Shell scripts require that the Microsoft Intune management agent is successfully installed on the macOS device. If you have enrolled the macOS devices into Intune, you don’t have to worry about this.
  • Shell scripts deployed via Intune run in parallel on devices as separate processes.
  • Shell scripts that are run as the signed-in user will run for all currently signed-in user accounts on the device at the time of the run.
  • An end user is required to sign in to the device to execute scripts running as a signed-in user.
  • Root user privileges are required if the script requires making changes that a standard user account cannot.
  • Shell scripts will attempt to run more frequently than the chosen script frequency for certain conditions. For example, if the disk is full, if the storage location is tampered with, if the local cache is deleted, or if the Mac device restarts.
  • The shell scripts that are running for longer than 60 minutes are stopped and reported as “failed“.


Get the Shell Script Ready for macOS


As mentioned earlier, you must have the shell script ready so that you can run it on your macOS devices. I will be deploying a sample macOS shell script that will enable remote management on Mac.

For beginners, Remote Management in Mac lets remote users manage the device using Apple Remote Desktop. It permits those users who have predefined access to the device to manage the system, interact with users, configure preferences, deploy files, etc. Mac users can manage (turn on/off) the remote management from the System Preferences (System Settings> General > Sharing > Remote Management).

The below script activates the remote management on your macOS devices. Open the Notepad application, copy the below code to a file, and save it with the filename.sh (An SH file is a script that can be run with the Bash Unix shell). You’ll need to upload this file to Intune in the next step.

Note: Before you create and assign a shell script policy in Intune, it must be tested for functionality. Execute it manually on a Mac device to validate the script works.


Run Shell Scripts on macOS devices in Intune


Let’s go through the steps to run shell scripts on macOS devices in Intune. Use the following steps to create and assign a shell script policy to macOS devices in Intune.


  • Sign in to Microsoft Intune Admin Center.
  • Navigate to Devices > macOS and select Shell Scripts.
  • Click the Add button to create a Shell Script for macOS.


Enter a name for the profile in the Basics tab of the Add Script pane. Add a brief description of the policy.


For instance, you can enter the following information for the macOS Shell script:


https://www.truecrimecollectors.com/showthread.php?tid=6601

https://www.openhelbreath.com/showthread.php?tid=4487

http://forum.badcity.live/showthread.php?tid=22

https://www.63game.top/thread-4136-1-1.html

https://www.63game.top/thread-3473-1-1.html

https://www.63game.top/thread-3234-1-1.html

https://australiantravelforum.com/travel/showthread.php?tid=86325

https://tasarhoa.com/hoa/viewtopic.php?t=25945

http://www.yypf.com/showthread.php?tid=1516


Name: Enable Remote Management on macOS Devices

Description: Remote Management in Mac lets remote users manage the device with the help of Apple Remote Desktop.

Click Next.

On the Script Settings tab, you must upload the script. Click on the Browse icon and select the shell script. The macOS shell script file must be less than 200 KB in size. You can view the script that has been uploaded, but you cannot edit or modify the script at this time.

Scroll down a bit, and here you’ll find a few important settings that can be configured for your macOS script execution.

Run the script as a signed-in user: Select Yes to run the script with the user’s credentials on the device. Choose No (default) to run the script as the root user. By default, the script is run as the root user. The root user can make system changes that a standard user account can’t.

Hide script notifications on devices: By default, script notifications are shown for each script that is run. End users see an IT configuring your computer notification from Intune on macOS devices. When not configured, these messages are shown in Notification Center.

Script frequency: Select how often the script is to be run on macOS devices. Select Not configured (default) to run a script only once.

Max number of times to retry if the script fails: Select how many times the script should be run if it returns a non-zero exit code (zero meaning success). Select Not configured (default) to not retry when a script fails.

Comments

Popular posts from this blog

A Collection of Lesson Plans for Teaching Microsoft Office

These benefits help you train your understudies ventures, for instance, Word, Excel, PowerPoint, OneNote, Access, and Publisher inside the setting of authentic circumstances. visit here for more details : hulu.com/activate https://kunwal.kinja.com/what-youtube-premium-is-and-how-to-sign-up-1842017707?rev=1583132756466 Find exercise plans for simple, focus assessment, or auxiliary school understudies. Some may even be legitimate for fundamental PC classes at the school level. Best of all, most by far of these are free! 01 In any case, Check Your School District's Site  Most educators know whether their school area offers PC capacities instructive projects or exercise plans. https://sites.google.com/site/ecoword016/ http://misha001.booklikes.com/post/2071089/top-office-software-and-apps-for-the-windows-phone https://pastelink.net/1d6b6 Some school region even post free resources on the web, so you can research and perhaps download resources. If you are new to an app

Why You Should Try to Fix Your Computer Problem Yourself

Perhaps the greatest misinterpretation about PCs is that it takes a scientific genius to fix any issue that may appear on one. We're here to reveal to you that fixing your PC is something you can do. Presently, not the slightest bit are we calling down your nearby PC fix individual they're all around an extremely brilliant pack of individuals, for the most part with a ton of instruction and experience. Visit here for more details : mcafee activate In any case, the reality remains that a huge part of the issues that PC clients experience can be by following uninhibitedly accessible counsel on this and different destinations on the web. http://www.bestbuydir.com/hulu-sign-in_213596.html http://www.bestbuydir.com/create-hulu-account_213597.html http://www.bestbuydir.com/activate-hulu_213598.html http://www.bestbuydir.com/Activation-Roku-Code-Link_213600.html http://www.bestbuydir.com/office-setup-and-enter-product-key_213601.html http://www.target-directory.com/norton-i

How to Connect your Xbox One to iOS Device ?

Microsoft's devoted Xbox cell phone application is an extraordinary route for players to remain drew in with their gaming companions while in a hurry. Like Sony's PlayStation application, the Xbox application enables clients to buy diversions, share content, see their accomplishments, and send updates to their supporters on Xbox Live. It likewise gives extra devices to review accomplishments, controlling motion picture playback, and getting to social components, for example, profiles and informing, which is all significantly more advantageous than signing onto your reassure or PC to do a similar thing. https://www.direct-directory.com/index.php?p=d https://www.dbsdirectory.com/index.php?p=d   get more information visit here  : www.office.com/setup Everything necessary to oversee your Xbox experience is a tad of tolerance. The procedure for blending your gadgets is presently less demanding than at any other time, so read on for our brisk guide on the most proficient met