5

Deploying macOS apps with the Intune scripting agent

 3 years ago
source link: https://techcommunity.microsoft.com/t5/intune-customer-success/deploying-macos-apps-with-the-intune-scripting-agent/ba-p/2298072?WT_mc_id=DOP-MVP-4025064
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Deploying macOS apps with the Intune scripting agent

Deploying macOS apps with the Intune scripting agent

Published 04-27-2021 08:00 AM 1,543 Views

By Neil Johnson – Principal Program Manager | Microsoft Endpoint Manager – Intune



The recommended methods of deploying apps with Microsoft Intune are the built-in app deployment features for Edge, Office and Defender. We also support Mac App Store and line-of-business apps. However, there are occasions where an application you need is not made by Microsoft, is not in the Mac App Store, and is not supported by the Intune line of business App Wrapping Tool.



Before we get into the details, it’s important that you understand the supportability of the process we are about to discuss:



Important: From a support perspective, Microsoft fully supports Intune and its ability to deploy shell scripts to macOS. However, Microsoft does not support the scripts themselves, even if they are on our GitHub repository. They are provided for example only and you are responsible for anything that they may do within your environment. Always test!



For the remainder of this post, I’m going to walk you through an example for how to approach the scenario where you need to do a bit of scripting. The steps we’re going to take are as follows:



Again, please do see the caveat above regarding supportability and also testing! I work with several customers who are really familiar with scripting and deploying so I’m sharing best practices and a few things we’ve all learned along the way.



Example Application Deployment: GNU Imagine Manipulation Program (GIMP)

We’re using Gimp here for a simple example. Gimp you can completely deploy following the steps outlined in our app wrapping post. The app makes a great example, too, to deploy through the scripting agent.



Step 1 – Obtaining the binary

First things first, we need to get a copy of Gimp. To do that we’ll head to the Gimp website and download the latest stable version. Save the file as gimp.dmg in the Downloads directory.



Screenshot of the gimp.dmg macOS app in the Downloads directory



Step 2 – Uploading to Azure Blob storage

Now that we have our installation file, we can upload to Azure so it’s ready for us to use. Setting up Azure Blob storage is outside the scope of this article, but you can find documentation here: Introduction to blob storage – Azure Storage | Microsoft Docs.



Note: It is not a requirement to use Azure storage – see the note on download URL later in this post.



Upload gimp.dmg to Azure Blob storage:



Note on Blob storage security: If you do not want to permit anonymous access to your Blob storage binaries you can set the access level to your container to ‘Private’ (no anonymous access) and generate a SAS access URL instead. The rest of this process will remain the same but the URL you use will have additional information encoded at the end.



Screenshot showing that setting container "macapps" public access level is Private when public access disallowed



Note on download URLs: If you don’t have Azure Blob storage, you can use the public download URL for Gimp from their website here instead. I like using Azure because it gives us more control over the process and the version that we install, but the rest of the process in this post will work fine using either Azure Blob storage or the public download URL from the Gimp servers.



Step 3 – Write the bash script to download and install Gimp

In this section we will walk through an example shell script from the Intune Shell Script GitHub Repository to download and install Gimp.



We’re going to require a couple of things before we begin:





Open the installGimp.sh file in Visual Studio Code. The bits we might want to change are shown on lines 20-27. These variables control how the script will behave. Let’s look at them in some more detail.





# User Defined variables
weburl="https://neiljohn.blob.core.windows.net/macapps/gimp.dmg"
appname="Gimp"
app="Gimp.app"
logandmetadir="/Library/Logs/Microsoft/IntuneScripts/installGimp"
processpath="/Applications/Gimp.app/Contents/MacOS/gimp"
terminateprocess="false"
autoupdate=”false”








For this example, the only thing that you need to change here is the weburl to your Azure Blob storage location (or use the public download URL https://download.gimp.org/mirror/pub/gimp/v2.10/osx/gimp-2.10.22-x86_64-3.dmg). The rest of the script can be left as is, but it is a good idea to read through it to ensure that you understand what it does.



Now we have our script, we need to test it. The easiest way to do that is to run it on a test device.



We need to make the script executable with chmod which we will run in a terminal window.



Neils-MacBook-Pro:Gimp neiljohnson$ chmod +x ~/Downloads/installGimp.sh


 Next, we can give the script a test run to check that it works. We need to run it as root so don’t forget the sudo command.



Neils-MacBook-Pro:Gimp % sudo ./installGimp.sh






Fri  9 Apr 2021 15:12:42 BST | Creating [/Library/Logs/Microsoft/IntuneScripts/installGimp] to store logs

##############################################################

# Fri  9 Apr 2021 15:12:42 BST | Logging install of [Gimp] to [/Library/Logs/Microsoft/IntuneScripts/installGimp/Gimp.log]

############################################################

Fri  9 Apr 2021 15:12:42 BST | Checking if we need Rosetta 2 or not
Fri  9 Apr 2021 15:12:42 BST | Waiting for other [/usr/sbin/softwareupdate] processes to end
Fri  9 Apr 2021 15:12:42 BST | No instances of [/usr/sbin/softwareupdate] found, safe to proceed
Fri  9 Apr 2021 15:12:42 BST | [Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz] found, Rosetta not needed
Fri  9 Apr 2021 15:12:42 BST | Checking if we need to install or update [Gimp]
Fri  9 Apr 2021 15:12:42 BST | [Gimp] not installed, need to download and install
Fri  9 Apr 2021 15:12:42 BST | Dock is here, lets carry on
Fri  9 Apr 2021 15:12:42 BST | Starting downlading of [Gimp]
Fri  9 Apr 2021 15:12:42 BST | Waiting for other [curl] processes to end
Fri  9 Apr 2021 15:12:42 BST | No instances of [curl] found, safe to proceed
Fri  9 Apr 2021 15:12:42 BST | Downloading Gimp
Fri  9 Apr 2021 15:13:13 BST | Downloaded [Gimp.app] to [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.WlgvmHH8/gimp.dmg]
Fri  9 Apr 2021 15:13:13 BST | Detected install type as [DMG]
Fri  9 Apr 2021 15:13:13 BST | Waiting for other [/Applications/Gimp.app/Contents/MacOS/gimp] processes to end
Fri  9 Apr 2021 15:13:13 BST | No instances of [/Applications/Gimp.app/Contents/MacOS/gimp] found, safe to proceed
Fri  9 Apr 2021 15:13:13 BST | Waiting for other [installer -pkg] processes to end
Fri  9 Apr 2021 15:13:13 BST | No instances of [installer -pkg] found, safe to proceed
Fri  9 Apr 2021 15:13:13 BST | Waiting for other [rsync -a] processes to end
Fri  9 Apr 2021 15:13:13 BST | No instances of [rsync -a] found, safe to proceed
Fri  9 Apr 2021 15:13:13 BST | Waiting for other [unzip] processes to end
Fri  9 Apr 2021 15:13:13 BST | No instances of [unzip] found, safe to proceed
Fri  9 Apr 2021 15:13:13 BST | Installing [Gimp]
Fri  9 Apr 2021 15:13:13 BST | Mounting Image
Fri  9 Apr 2021 15:13:30 BST | Copying app files to /Applications/Gimp.app
Fri  9 Apr 2021 15:22:28 BST | Un-mounting [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.WlgvmHH8/Gimp]
Fri  9 Apr 2021 15:22:28 BST | [Gimp] Installed
Fri  9 Apr 2021 15:22:28 BST | Cleaning Up
Fri  9 Apr 2021 15:22:28 BST | Fixing up permissions
Fri  9 Apr 2021 15:22:30 BST | Application [Gimp] succesfully installed
Fri  9 Apr 2021 15:22:31 BST | Writing last modifieddate [Tue, 06 Apr 2021 14:04:10 GMT] to [/Library/Logs/Microsoft/IntuneScripts/installGimp/Gimp.meta]






Once that’s done, try to launch the Gimp application to check that it installed correctly and that it works ok. Press CMD+Space and type in ‘Gimp’, then press Return. The Gimp splash screen should appear, and the application should start.



Screenshot of the GIMP splash screen



Assuming everything went well to this point, all we need to do now is to deploy the script via Intune.



Step 4 - Deploy the bash script via the Intune scripting agent.

At this point we have a script that we’re confident works when we run it locally and so the next step is to upload it to Intune and assign it to some test users to check that it behaves as we expect when it’s run via the Intune Scripting Agent.



To deploy the script via Intune:





The final step on the client Mac is to check that the app has installed, and we can launch it. Press CMD+Space and type "Gimp" and press Enter. The Gimp app should launch.



Example of launching the Gimp app to validate app installation on a macOS device



At this stage we’re happy that the script deploys the app successfully. All that is left is to set the assignment policy of the script to include all the users that you need to install the Gimp app to.



Handling version updates

Some apps handle updates automatically and some apps don’t. For this example, Gimp doesn’t automatically update so we’re going to need to handle that. Luckily, the example script already handles updates so all that we need to do is to upload a newer version of gimp.dmg to Blob storage or change the URL in the script to a newer version on the Gimp website. It’s really that simple.



If you want more detail, when we created our script policy in Intune, we set the schedule to run every day. To prevent the script from installing Gimp every time it runs, there are a few functions to handle updates and downloads.







We can see these functions in action simply by running the script twice. On a test machine, if we download installGimp.sh and run it twice, on the second time through we’ll see the following log entry.







Neils-MacBook-Pro:Gimp % % sudo ./installGimp.sh 

##############################################################
# Tue  6 Apr 2021 14:46:09 BST | Logging install of [Gimp] to [/Library/Logs/Microsoft/IntuneScripts/installGimp/Gimp.log]
############################################################

Tue  6 Apr 2021 14:46:09 BST | Checking if we need Rosetta 2 or not
Tue  6 Apr 2021 14:46:09 BST | [Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz] found, Rosetta not needed
Tue  6 Apr 2021 14:46:09 BST | Checking if we need to install or update [Gimp]
Tue  6 Apr 2021 14:46:09 BST | [Gimp] already installed, let's see if we need to update
Tue  6 Apr 2021 14:46:10 BST | No update between previous [Tue, 06 Apr 2021 12:03:05 GMT] and current [Tue, 06 Apr 2021 12:03:05 GMT]
Tue  6 Apr 2021 14:46:10 BST | Exiting, nothing to do






We can see from the log that there has been no update and so the script doesn’t re-install Gimp.



To show the update process working, update the gimp.dmg file in Azure Blob storage. Repeat steps 1 and 2 above.



During step 2, make sure that you use the same file name and that you check the Overwrite if files already exist checkbox.

Screenshot of the Overwrite if files already exist checkbox option in Intune



Once the upload is complete, re-run the script on the test device.





Neils-MacBook-Pro:Gimp % sudo ./installGimp.sh 

##############################################################
# Tue  6 Apr 2021 15:05:23 BST | Logging install of [Gimp] to [/Library/Logs/Microsoft/IntuneScripts/installGimp/Gimp.log]
############################################################

Tue  6 Apr 2021 15:05:23 BST | Checking if we need Rosetta 2 or not
Tue  6 Apr 2021 15:05:23 BST | [Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz] found, Rosetta not needed
Tue  6 Apr 2021 15:05:23 BST | Checking if we need to install or update [Gimp]
Tue  6 Apr 2021 15:05:23 BST | [Gimp] already installed, let's see if we need to update
Tue  6 Apr 2021 15:05:23 BST | Update found, previous [Tue, 06 Apr 2021 12:03:05 GMT] and current [Tue, 06 Apr 2021 14:04:10 GMT]
Tue  6 Apr 2021 15:05:23 BST | Starting downlading of [Gimp]
Tue  6 Apr 2021 15:05:23 BST | Waiting for other Curl processes to end
Tue  6 Apr 2021 15:05:23 BST | No instances of Curl found, safe to proceed
Tue  6 Apr 2021 15:05:23 BST | Octory found, attempting to send status updates
Tue  6 Apr 2021 15:05:23 BST | Updating Octory monitor for [Gimp] to [installing]
Tue  6 Apr 2021 15:05:24 BST | Downloading Gimp
Tue  6 Apr 2021 15:06:00 BST | Downloaded [Gimp.app]
Tue  6 Apr 2021 15:06:00 BST | Checking if the application is running
Tue  6 Apr 2021 15:06:00 BST | [Gimp] isn't running, lets carry on
Tue  6 Apr 2021 15:06:00 BST | Installing [Gimp]
Tue  6 Apr 2021 15:06:00 BST | Octory found, attempting to send status updates
Tue  6 Apr 2021 15:06:00 BST | Updating Octory monitor for [Gimp] to [installing]
Tue  6 Apr 2021 15:06:00 BST | Mounting [/tmp/gimp.dmg] to [/tmp/Gimp]
Tue  6 Apr 2021 15:06:21 BST | Copying /tmp/Gimp/*.app to /Applications/Gimp.app
Tue  6 Apr 2021 15:15:43 BST | Un-mounting [/tmp/Gimp]
Tue  6 Apr 2021 15:15:44 BST | [Gimp] Installed
Tue  6 Apr 2021 15:15:44 BST | Cleaning Up
Tue  6 Apr 2021 15:15:44 BST | Fixing up permissions
Tue  6 Apr 2021 15:15:46 BST | Application [Gimp] succesfully installed
Tue  6 Apr 2021 15:15:46 BST | Writing last modifieddate [Tue, 06 Apr 2021 14:04:10 GMT] to [/Library/Logs/Microsoft/IntuneScripts/installGimp/Gimp.meta]
Tue  6 Apr 2021 15:15:46 BST | Octory found, attempting to send status updates






Adapting the example script to something else: Yammer

We have our Gimp script working as we want, but what about other installer files? In this example, we are going to look at modifying the InstallGimp.sh script to handle Yammer, which is also provided as a DMG file.



The completed script for Yammer is available here. If we look at a comparison of changes between the installGimp.sh and installYammer.sh scripts, we can see that the only differences are on lines 21-27.



Comparison of changes between the installGimp.sh and installYammer.sh scripts



The changes on line 6 are just a description of the script. Lines 20-27 are variables that are discussed in more detail in Step 3 above.





# User Defined variables
weburl="https://aka.ms/yammer_desktop_mac"
appname="Yammer"
app="Yammer.app"
logandmetadir="/Library/Logs/Microsoft/IntuneScripts/installYammer"
processpath="/Applications/Yammer.app/Contents/MacOS/Yammer"
terminateprocess="false"
autoUpdate=”false”






Note: That in this example we are not using Azure blob storage but the normal download URL for Yammer. After editing the script we then follow the steps in Step 4 - Deploy the bash script via the Intune scripting agent above. Once deployed, we can go to the Mac and trigger a manual check-in and then check the logs on our target Mac.



For Yammer, our new policy ID is: 010f31ef-1cfc-441b-a409-fc75e838c5d0



From the IntuneMDMDaemon*.log file we see the following:





IntuneMDM-Daemon | I | *10068 | ScriptPolicyHandler | Running script policy PolicyID: 010f31ef-1cfc-441b-a409-fc75e838c5d0
IntuneMDM-Daemon | I | *10068 | ScriptPolicyHandler | Delivering user notification. PolicyID: 010f31ef-1cfc-441b-a409-fc75e838c5d0, BlockExecutionNotifications: true
IntuneMDM-Daemon | I | 12959 | ScriptPolicyHandler | Script ran PolicyID: 010f31ef-1cfc-441b-a409-fc75e838c5d0, TotalRetries: 0, Status: Success, ExitCode: 0
IntuneMDM-Daemon | I | 12959 | ScriptPolicyHandler | Script policy succeeded PolicyID: 010f31ef-1cfc-441b-a409-fc75e838c5d0, TotalRetries: 0, ExitCode: 0
IntuneMDM-Daemon | I | 12959 | ScriptPolicyHandler | Adding script to scheduler PolicyID: 010f31ef-1cfc-441b-a409-fc75e838c5d0






And from the /Library/Logs/Microsoft/IntuneScripts/installYammer/Yammer.log we see the following:





Sat 10 Apr 2021 17:38:30 BST | Creating [/Library/Logs/Microsoft/IntuneScripts/installYammer] to store logs
 
##############################################################
# Sat 10 Apr 2021 17:38:30 BST | Logging install of [Yammer] to [/Library/Logs/Microsoft/IntuneScripts/installYammer/Yammer.log]
############################################################
 
Sat 10 Apr 2021 17:38:30 BST | Checking if we need Rosetta 2 or not
Sat 10 Apr 2021 17:38:30 BST | Waiting for other [/usr/sbin/softwareupdate] processes to end
Sat 10 Apr 2021 17:38:30 BST | No instances of [/usr/sbin/softwareupdate] found, safe to proceed
Sat 10 Apr 2021 17:38:30 BST | [Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz] found, Rosetta not needed
Sat 10 Apr 2021 17:38:30 BST | Checking if we need to install or update [Yammer]
Sat 10 Apr 2021 17:38:30 BST | [Yammer] not installed, need to download and install
Sat 10 Apr 2021 17:38:30 BST | Dock is here, lets carry on
Sat 10 Apr 2021 17:38:30 BST | Starting downlading of [Yammer]
Sat 10 Apr 2021 17:38:30 BST | Waiting for other [curl] processes to end
Sat 10 Apr 2021 17:38:30 BST | No instances of [curl] found, safe to proceed
Sat 10 Apr 2021 17:38:30 BST | Downloading Yammer
Sat 10 Apr 2021 17:38:49 BST | Unknown file type [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.U6LKs7Fb/yammer_desktop_mac], analysing metadata
Sat 10 Apr 2021 17:38:49 BST | Downloaded [Yammer.app] to [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.U6LKs7Fb/install.dmg]
Sat 10 Apr 2021 17:38:49 BST | Detected install type as [DMG]
Sat 10 Apr 2021 17:38:49 BST | Waiting for other [/Applications/Yammer.app/Contents/MacOS/Yammer] processes to end
Sat 10 Apr 2021 17:38:49 BST | No instances of [/Applications/Yammer.app/Contents/MacOS/Yammer] found, safe to proceed
Sat 10 Apr 2021 17:38:49 BST | Installing [Yammer]
Sat 10 Apr 2021 17:38:49 BST | Mounting Image
Sat 10 Apr 2021 17:38:56 BST | Copying app files to /Applications/Yammer.app
Sat 10 Apr 2021 17:39:14 BST | Un-mounting [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.U6LKs7Fb/Yammer]
Sat 10 Apr 2021 17:39:14 BST | [Yammer] Installed
Sat 10 Apr 2021 17:39:14 BST | Cleaning Up
Sat 10 Apr 2021 17:39:14 BST | Fixing up permissions
Sat 10 Apr 2021 17:39:14 BST | Application [Yammer] succesfully installed






To validate the installation, launch the Yammer app by pressing CMD+Space and typing "Yammer" and then Enter. Assuming everything works as expected, the next step is to repeat step 4 above (Deploy the bash script with Intune Scripting Agent) and assign it to your users.



What about other package types? APP or PKG?

This approach can be used for any macOS installer that can be triggered from the shell. The script attempts to determine the correct installer type from the downloaded file.



More examples using the same script can be found here:



The best way to get started is to download one of the example scripts and modify it for your application.



Some of the examples use weburls on Azure blob storage and others pull directly from the source download sites (like Company Portal). The script uses curl -OJL <url> to download the installer and create the temp file.



Note: If the app you are trying to deploy is provided to you as an .app file, you can compress the app into a ZIP and use the examples above.



All the examples include a function to handle Rosetta 2 deployment for Apple Silicon devices. That means these scripts can be deployed straight to an M1 Mac and it will automatically handle the installation of Rosetta 2 so that the application can run.



Troubleshooting

Using Microsoft Endpoint Manager admin centerIntune also reports the status of each script in the UI.





To make sense of the logs, it’s useful to know the policy ID of the script we are troubleshooting. We can get this from the Microsoft Endpoint Manager admin center.





The easiest way to view the logs is via the Console app.





The key things to look for in the IntuneMDMDaemon log are as follows:



Note: You can also view the logs directly on the Mac if you have access. Use Console again to view them.





Script Log

This is the log that is generated by each script so the output will be different depending on what you put in your script. The best way to view is in the Console app. Search for ‘Gimp’. The log file output should look very similar to the output we saw when we ran the script manually.



Example screenshot of the log output for the GIMP app on a macOS device



Version Reporting

One of the biggest problems with this approach of app deployment is that apps deployed in this way do not show up in the ‘managed apps’ list for each managed Mac in Intune. To help mitigate this a little, we can use Intune’s custom attribute feature to run a shell script on the Mac and return the version of our app.



We have an example custom attribute script to return the version of a Mac app here.



To deploy the custom attribute script:





The next time that the Intune macOS script agent checks-in to Intune, it will run the script and return the value. To see a list of the returned values:





This report can be exported to a CSV file if required.



Obviously, this is a basic example, but it could be expanded to return any information that you can gather from a shell script.



Summary

Hopefully this blog and example scripts have provided some guidance around the possibilities of deploying apps via the Intune script agent and Azure Blob storage (or other web hosting sites).



This approach is especially useful for applications that cannot be deployed via the other App deployment scenarios that Intune provides.



Advantages Disadvantages



For more information on deploying scripts with Intune see our documentation here. We also have a broader set of shell script examples on the Intune team GitHub Repository.



Let us know if you have any questions by replying to this post or reaching out to @IntuneSuppTeam on Twitter.

1 Comment

‎Apr 29 2021 08:40 AM

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

%3CLINGO-SUB%20id%3D%22lingo-sub-2298072%22%20slang%3D%22en-US%22%3EDeploying%20macOS%20apps%20with%20the%20Intune%20scripting%20agent%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2298072%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EBy%20Neil%20Johnson%20%E2%80%93%20Principal%20Program%20Manager%20%7C%20Microsoft%20Endpoint%20Manager%20%E2%80%93%20Intune%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20recommended%20methods%20of%20deploying%20apps%20with%20Microsoft%20Intune%20are%20the%20built-in%20app%20deployment%20features%20for%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fapps-edge-macos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EEdge%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fapps-add-office365-macos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOffice%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fapps-advanced-threat-protection-macos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDefender%3C%2FA%3E.%20We%20also%20support%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fvpp-apps-ios%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMac%20App%20Store%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Flob-apps-macos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eline-of-business%20apps%3C%2FA%3E.%20However%2C%20there%20are%20occasions%20where%20an%20application%20you%20need%20is%20not%20made%20by%20Microsoft%2C%20is%20not%20in%20the%20Mac%20App%20Store%2C%20and%20is%20not%20supported%20by%20the%20Intune%20line%20of%20business%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fdeveloper%2Fapps-prepare-mobile-application-management%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EApp%20Wrapping%20Tool%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20we%20get%20into%20the%20details%2C%20it%E2%80%99s%20important%20that%20you%20understand%20the%20supportability%20of%20the%20process%20we%20are%20about%20to%20discuss%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSTRONG%3EImportant%3C%2FSTRONG%3E%3A%20From%20a%20support%20perspective%2C%20Microsoft%20fully%20supports%20Intune%20and%20its%20ability%20to%20deploy%20shell%20scripts%20to%20macOS.%20However%2C%20Microsoft%20%3CU%3Edoes%20not%20support%3C%2FU%3E%20the%20scripts%20themselves%2C%20%3CU%3Eeven%20if%20they%20are%20on%20our%20GitHub%20repository%3C%2FU%3E.%20%3CSTRONG%3EThey%20are%20provided%20for%20example%20only%20and%20you%20are%20responsible%20for%20anything%20that%20they%20may%20do%20within%20your%20environment.%3C%2FSTRONG%3E%20Always%20test!%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20the%20remainder%20of%20this%20post%2C%20I%E2%80%99m%20going%20to%20walk%20you%20through%20an%20example%20for%20how%20to%20approach%20the%20scenario%20where%20you%20need%20to%20do%20a%20bit%20of%20scripting.%20The%20steps%20we%E2%80%99re%20going%20to%20take%20are%20as%20follows%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIdentify%20a%20web%20location%20from%20which%20to%20download%20the%20app.%3C%2FLI%3E%0A%3CLI%3EWrite%20a%20bash%20script%20to%20download%20the%20installer%20and%20install%20the%20app.%3C%2FLI%3E%0A%3CLI%3EDeploy%20the%20bash%20script%20using%20the%20Intune%20scripting%20agent.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAgain%2C%20please%20do%20see%20the%20caveat%20above%20regarding%20supportability%20and%20also%20testing!%20I%20work%20with%20several%20customers%20who%20are%20really%20familiar%20with%20scripting%20and%20deploying%20so%20I%E2%80%99m%20sharing%20best%20practices%20and%20a%20few%20things%20we%E2%80%99ve%20all%20learned%20along%20the%20way.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-2006233395%22%20id%3D%22toc-hId-2006232621%22%3EExample%20Application%20Deployment%3A%20GNU%20Imagine%20Manipulation%20Program%20(GIMP)%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EWe%E2%80%99re%20using%20Gimp%20here%20for%20a%20simple%20example.%20Gimp%20you%20can%20completely%20deploy%20following%20the%20steps%20outlined%20in%20our%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fintune-customer-success%2Fhow-to-deploy-dmg-or-app-format-apps-to-intune-managed-macs%2Fba-p%2F1503416%22%20target%3D%22_blank%22%3Eapp%20wrapping%20post%3C%2FA%3E.%20The%20app%20makes%20a%20great%20example%2C%20too%2C%20to%20deploy%20through%20the%20scripting%20agent.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1598172427%22%20id%3D%22toc-hId--1598173201%22%3E%3CSPAN%3EStep%201%20%E2%80%93%20Obtaining%20the%20binary%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EFirst%20things%20first%2C%20we%20need%20to%20get%20a%20copy%20of%20Gimp.%20To%20do%20that%20we%E2%80%99ll%20head%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.gimp.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EGimp%20website%3C%2FA%3E%20and%20download%20the%20latest%20stable%20version.%20Save%20the%20file%20as%20%3CSTRONG%3Egimp.dmg%3C%2FSTRONG%3E%20in%20the%20Downloads%20directory.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-1.png%22%20style%3D%22width%3A%20902px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275833i5681E112EF6B0983%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-1.png%22%20alt%3D%22Screenshot%20of%20the%20gimp.dmg%20macOS%20app%20in%20the%20Downloads%20directory%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EScreenshot%20of%20the%20gimp.dmg%20macOS%20app%20in%20the%20Downloads%20directory%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-889340406%22%20id%3D%22toc-hId-889339632%22%3E%3CSPAN%3EStep%202%20%E2%80%93%20Uploading%20to%20Azure%20Blob%20storage%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3ENow%20that%20we%20have%20our%20installation%20file%2C%20we%20can%20upload%20to%20Azure%20so%20it%E2%80%99s%20ready%20for%20us%20to%20use.%20Setting%20up%20Azure%20Blob%20storage%20is%20outside%20the%20scope%20of%20this%20article%2C%20but%20you%20can%20find%20documentation%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fstorage%2Fblobs%2Fstorage-blobs-introduction%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIntroduction%20to%20blob%20storage%20%E2%80%93%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3ENote%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3A%20It%20is%20not%20a%20requirement%20to%20use%20Azure%20storage%20%E2%80%93%20see%20the%20note%20on%20download%20URL%20later%20in%20this%20post.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EUpload%20gimp.dmg%20to%20Azure%20Blob%20storage%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EGo%20to%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fazure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3Eportal.azure.com%3C%2FSTRONG%3E%3C%2FA%3E%20%26gt%3B%20%3CSTRONG%3EStorage%20Accounts%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3E%E2%80%9Cyour%20storage%20account%E2%80%9D%3C%2FSTRONG%3E%20and%20select%20the%20container%20you%20wish%20to%20use%20for%20macOS%20app%20deployments.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20%3CSTRONG%3EUpload%3C%2FSTRONG%3E%20%26gt%3B%20Provide%20the%20file%20path%20to%20%3CSTRONG%3Egimp.dmg%3C%2FSTRONG%3E%20and%20click%20upload%20again.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EOnce%20uploaded%2C%20you%20will%20see%20your%20file%20listed%20in%20the%20container.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275834iBAB795DD5192EB67%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-2.png%22%20alt%3D%22Example%20of%20gimp.dmg%20uploaded%20in%20an%20Azure%20storage%20account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20of%20gimp.dmg%20uploaded%20in%20an%20Azure%20storage%20account%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EClick%20on%20%3CSTRONG%3Egimp.dmg%3C%2FSTRONG%3E%20and%20make%20a%20note%20of%20the%20URL%20in%20the%20properties.%20In%20my%20case%2C%20the%20URL%20is%20%3CA%20href%3D%22https%3A%2F%2Fneiljohn.blob.core.windows.net%2Fmacapps%2Fgimp.dmg%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fneiljohn.blob.core.windows.net%2Fmacapps%2Fgimp.dmg%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3ENote%20on%20Blob%20storage%20security%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3A%20If%20you%20do%20not%20want%20to%20permit%20anonymous%20access%20to%20your%20Blob%20storage%20binaries%20you%20can%20set%20the%20access%20level%20to%20your%20container%20to%20%E2%80%98Private%E2%80%99%20(no%20anonymous%20access)%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fstorage%2Fcommon%2Fstorage-sas-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Egenerate%20a%20SAS%20access%20URL%20instead%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E.%20The%20rest%20of%20this%20process%20will%20remain%20the%20same%20but%20the%20URL%20you%20use%20will%20have%20additional%20information%20encoded%20at%20the%20end.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-3.png%22%20style%3D%22width%3A%20907px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275835i3C7658053999F5EA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-3.png%22%20alt%3D%22Screenshot%20showing%20that%20setting%20container%20%26quot%3Bmacapps%26quot%3B%20public%20access%20level%20is%20Private%20when%20public%20access%20disallowed%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EScreenshot%20showing%20that%20setting%20container%20%22macapps%22%20public%20access%20level%20is%20Private%20when%20public%20access%20disallowed%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3ENote%20on%20download%20URLs%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3A%20If%20you%20don%E2%80%99t%20have%20Azure%20Blob%20storage%2C%20you%20can%20use%20the%20public%20download%20URL%20for%20Gimp%20from%20their%20website%20%3CA%20href%3D%22https%3A%2F%2Fwww.gimp.org%2Fdownloads%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehere%3C%2FA%3E%20instead.%20I%20like%20using%20Azure%20because%20it%20gives%20us%20more%20control%20over%20the%20process%20and%20the%20version%20that%20we%20install%2C%20but%20the%20rest%20of%20the%20process%20in%20this%20post%20will%20work%20fine%20using%20either%20Azure%20Blob%20storage%20or%20the%20public%20download%20URL%20from%20the%20Gimp%20servers.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--918114057%22%20id%3D%22toc-hId--918114831%22%3E%3CSPAN%3EStep%203%20%E2%80%93%20Write%20the%20bash%20script%20to%20download%20and%20install%20Gimp%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EIn%20this%20section%20we%20will%20walk%20through%20an%20example%20shell%20script%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIntune%20Shell%20Script%20GitHub%20Repository%3C%2FA%3E%20to%20download%20and%20install%20Gimp.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%E2%80%99re%20going%20to%20require%20a%20couple%20of%20things%20before%20we%20begin%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EDownload%20the%20example%20%3CSTRONG%3EinstallGimp.sh%3C%2FSTRONG%3E%20file%20from%20%3CA%20href%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fshell-intune-samples%2Fmaster%2FApps%2FGimp%2FInstallGimp.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehere%3C%2FA%3E%20and%20save%20it%20to%20your%20local%20drive.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EDownload%20and%20install%20a%20copy%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EVisual%20Studio%20Code%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOpen%20the%20%3CSTRONG%3EinstallGimp.sh%3C%2FSTRONG%3E%20file%20in%20%3CSTRONG%3EVisual%20Studio%20Code%3C%2FSTRONG%3E.%20The%20bits%20we%20might%20want%20to%20change%20are%20shown%20on%20lines%2020-27.%20These%20variables%20control%20how%20the%20script%20will%20behave.%20Let%E2%80%99s%20look%20at%20them%20in%20some%20more%20detail.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20User%20Defined%20variables%0Aweburl%3D%22https%3A%2F%2Fneiljohn.blob.core.windows.net%2Fmacapps%2Fgimp.dmg%22%0Aappname%3D%22Gimp%22%0Aapp%3D%22Gimp.app%22%0Alogandmetadir%3D%22%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%22%0Aprocesspath%3D%22%2FApplications%2FGimp.app%2FContents%2FMacOS%2Fgimp%22%0Aterminateprocess%3D%22false%22%0Aautoupdate%3D%E2%80%9Dfalse%E2%80%9D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3Eweburl%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bis%20the%20http%20URL%20of%20the%20installation%20files%20that%20we%20need.%20In%20this%20example%20we%20are%20using%20Azure%20Blob%20storage%20to%20host%20the%20file%2C%20but%20it%20could%20be%20any%20http%20endpoint%20that%20will%20be%20accessible%20from%20the%20client%3C%2FSPAN%3E%3CSPAN%3E.%20The%20script%20will%20attempt%20to%20autodetect%20the%20installer%20type%20based%20on%20the%20file%20that%20is%20downloaded.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Eappname%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bis%20mostly%20used%20in%20the%20log%2C%20but%20is%20also%20used%20to%20generate%20the%20metadata%20file%20path%20for%20storing%20the%20last%20updated%20date.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Eapp%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bis%20the%20actual%20name%20of%20the%20Application.%20It%20is%20used%20by%20the%20script%20to%20check%20if%20the%20app%20is%20already%20installed.%20The%20script%20will%20copy%20the%20application%20files%20found%20on%20the%20DMG%20to%20%2FApplications%2F%24app.%20The%20best%20way%20to%20find%20out%20what%20this%20should%20be%20set%20to%20is%20to%20install%20the%20application%20manually%20on%20your%20Mac%20and%20then%20run%20%3CSTRONG%3Els%20-la%20%2FApplications%3C%2FSTRONG%3E%20from%20a%20terminal%20prompt%20and%20use%20the%20same%20name%20in%20the%20%3CSTRONG%3Eapp%3C%2FSTRONG%3E%20variable.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Elogandmetadir%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bthis%20is%20the%20directory%20that%20the%20script%20will%20use%20to%20store%20the%20installation%20log%20and%20to%20store%20the%20metadata%20for%20the%20last%20version%20update.%20This%20should%20be%20unique%20for%20each%20application%20that%20you%20deploy.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Eprocesspath%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bthis%20is%20used%20to%20check%20if%20the%20application%20is%20running%20or%20not.%20Mac%20applications%20have%20a%20strict%20directory%20format%2C%20so%20one%20of%20the%20quickest%20methods%20is%20to%20run%26nbsp%3B%3CSTRONG%3Els%20-Fl%20%2FApplications%2FGimp.app%2FContents%2FMacOS%2F*%3C%2FSTRONG%3E.%20This%20will%20return%20a%20list%20of%20files%2C%20it's%20usually%20easy%20to%20guess%20which%20one%20is%20the%20main%20application%20by%20the%20name%2C%20in%20our%20case%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%2FApplications%2FGimp.app%2FContents%2FMacOS%2Fgimp%3C%2FSTRONG%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Eterminateprocess%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bis%20used%20to%20control%20what%20the%20script%20does%20if%20it%20finds%20the%20application%20is%20running.%20If%20this%20value%20is%20set%20to%20%3CSTRONG%3Efalse%3C%2FSTRONG%3E%2C%20the%20script%20will%20check%20for%20the%20applications%20process%20and%20wait%20for%20it%20to%20be%20closed%20before%20installing.%20If%20the%20value%20is%20set%20to%20%3CSTRONG%3Etrue%3C%2FSTRONG%3E%2C%20the%20script%20will%20detect%20that%20the%20application%20is%20running%20and%20terminate%20the%20main%20process%20before%20installing.%20For%20most%20end%20user%20applications%20leave%20this%20set%20to%20false.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Eautoupdate%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bis%20used%20to%20control%20how%20the%20script%20behaves%20when%20it%E2%80%99s%20run%20after%20the%20app%20is%20installed.%20If%20%3CEM%3Eautoupdate%3C%2FEM%3E%20is%20set%20to%20%3CEM%3Etrue%3C%2FEM%3E%20the%20script%20will%20exit%20since%20it%20assumes%20that%20the%20app%20will%20handle%20updates%20itself.%20If%20set%20to%20%3CEM%3Efalse%3C%2FEM%3E%2C%20the%20script%20will%20compare%20current%20and%20last%20update%20times%20on%20the%20URL%20header%20and%20update%20if%20there%20is%20a%20newer%20version.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFor%20this%20example%2C%20the%20only%20thing%20that%20you%20need%20to%20change%20here%20is%20the%20%3CSTRONG%3Eweburl%3C%2FSTRONG%3E%20to%20your%20Azure%20Blob%20storage%20location%20(or%20use%20the%20public%20download%20URL%20%3CA%20href%3D%22https%3A%2F%2Fdownload.gimp.org%2Fmirror%2Fpub%2Fgimp%2Fv2.10%2Fosx%2Fgimp-2.10.22-x86_64-3.dmg%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fdownload.gimp.org%2Fmirror%2Fpub%2Fgimp%2Fv2.10%2Fosx%2Fgimp-2.10.22-x86_64-3.dmg%3C%2FA%3E).%20The%20rest%20of%20the%20script%20can%20be%20left%20as%20is%2C%20but%20it%20is%20a%20good%20idea%20to%20read%20through%20it%20to%20ensure%20that%20you%20understand%20what%20it%20does.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENow%20we%20have%20our%20script%2C%20we%20need%20to%20test%20it.%20The%20easiest%20way%20to%20do%20that%20is%20to%20run%20it%20on%20a%20test%20device.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20need%20to%20make%20the%20script%20executable%20with%20%3CSTRONG%3Echmod%3C%2FSTRONG%3E%20which%20we%20will%20run%20in%20a%20terminal%20window.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ENeils-MacBook-Pro%3AGimp%20neiljohnson%24%20%3CSTRONG%3Echmod%20%2Bx%20~%2FDownloads%2FinstallGimp.sh%3C%2FSTRONG%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BNext%2C%20we%20can%20give%20the%20script%20a%20test%20run%20to%20check%20that%20it%20works.%20We%20need%20to%20run%20it%20as%20root%20so%20don%E2%80%99t%20forget%20the%20%3CSTRONG%3Esudo%3C%2FSTRONG%3E%20command.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ENeils-MacBook-Pro%3AGimp%20%25%20sudo%20.%2FinstallGimp.sh%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Creating%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%5D%20to%20store%20logs%0A%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%0A%23%20Fri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Logging%20install%20of%20%5BGimp%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.log%5D%0A%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Checking%20if%20we%20need%20Rosetta%202%20or%20not%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Waiting%20for%20other%20%5B%2Fusr%2Fsbin%2Fsoftwareupdate%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20No%20instances%20of%20%5B%2Fusr%2Fsbin%2Fsoftwareupdate%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20%5BIntel(R)%20Core(TM)%20i9-9880H%20CPU%20%40%202.30GHz%5D%20found%2C%20Rosetta%20not%20needed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Checking%20if%20we%20need%20to%20install%20or%20update%20%5BGimp%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20%5BGimp%5D%20not%20installed%2C%20need%20to%20download%20and%20install%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Dock%20is%20here%2C%20lets%20carry%20on%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Starting%20downlading%20of%20%5BGimp%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Waiting%20for%20other%20%5Bcurl%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20No%20instances%20of%20%5Bcurl%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A12%3A42%20BST%20%7C%20Downloading%20Gimp%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Downloaded%20%5BGimp.app%5D%20to%20%5B%2Fvar%2Ffolders%2Fzz%2Fzyxvpxvq6csfxvn_n0000000000000%2FT%2Ftmp.WlgvmHH8%2Fgimp.dmg%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Detected%20install%20type%20as%20%5BDMG%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Waiting%20for%20other%20%5B%2FApplications%2FGimp.app%2FContents%2FMacOS%2Fgimp%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20No%20instances%20of%20%5B%2FApplications%2FGimp.app%2FContents%2FMacOS%2Fgimp%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Waiting%20for%20other%20%5Binstaller%20-pkg%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20No%20instances%20of%20%5Binstaller%20-pkg%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Waiting%20for%20other%20%5Brsync%20-a%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20No%20instances%20of%20%5Brsync%20-a%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Waiting%20for%20other%20%5Bunzip%5D%20processes%20to%20end%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20No%20instances%20of%20%5Bunzip%5D%20found%2C%20safe%20to%20proceed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Installing%20%5BGimp%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A13%20BST%20%7C%20Mounting%20Image%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A13%3A30%20BST%20%7C%20Copying%20app%20files%20to%20%2FApplications%2FGimp.app%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A28%20BST%20%7C%20Un-mounting%20%5B%2Fvar%2Ffolders%2Fzz%2Fzyxvpxvq6csfxvn_n0000000000000%2FT%2Ftmp.WlgvmHH8%2FGimp%5D%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A28%20BST%20%7C%20%5BGimp%5D%20Installed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A28%20BST%20%7C%20Cleaning%20Up%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A28%20BST%20%7C%20Fixing%20up%20permissions%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A30%20BST%20%7C%20Application%20%5BGimp%5D%20succesfully%20installed%0AFri%26nbsp%3B%209%20Apr%202021%2015%3A22%3A31%20BST%20%7C%20Writing%20last%20modifieddate%20%5BTue%2C%2006%20Apr%202021%2014%3A04%3A10%20GMT%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.meta%5D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOnce%20that%E2%80%99s%20done%2C%20try%20to%20launch%20the%20Gimp%20application%20to%20check%20that%20it%20installed%20correctly%20and%20that%20it%20works%20ok.%20Press%20%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ESpace%3C%2FSTRONG%3E%20and%20type%20in%20%E2%80%98%3CSTRONG%3EGimp%E2%80%99%3C%2FSTRONG%3E%2C%20then%20press%20Return.%20The%20Gimp%20splash%20screen%20should%20appear%2C%20and%20the%20application%20should%20start.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-4.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275836i6CDA4C439D27E007%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-4.png%22%20alt%3D%22Screenshot%20of%20the%20GIMP%20splash%20screen%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EScreenshot%20of%20the%20GIMP%20splash%20screen%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAssuming%20everything%20went%20well%20to%20this%20point%2C%20all%20we%20need%20to%20do%20now%20is%20to%20deploy%20the%20script%20via%20Intune.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1569398776%22%20id%3D%22toc-hId-1569398002%22%3E%3CSPAN%3EStep%204%20-%20Deploy%20the%20bash%20script%20via%20the%20Intune%20scripting%20agent.%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%3CSPAN%3EAt%20this%20point%20we%20have%20a%20script%20that%20we%E2%80%99re%20confident%20works%20when%20we%20run%20it%20locally%20and%20so%20the%20next%20step%20is%20to%20upload%20it%20to%20Intune%20and%20assign%20it%20to%20some%20test%20users%20to%20check%20that%20it%20behaves%20as%20we%20expect%20when%20it%E2%80%99s%20run%20via%20the%20Intune%20Scripting%20Agent.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20deploy%20the%20script%20via%20Intune%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3ESign%20in%20to%20the%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMEMAC%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20data-linktype%3D%22external%22%3EMicrosoft%20Endpoint%20Manager%20admin%20center%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20%3CSTRONG%3EDevices%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EmacOS%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EShell%20scripts%3C%2FSTRONG%3E%20%26gt%3B%20%3CEM%3EAdd%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EEnter%20a%20%3CEM%3EName%20%3C%2FEM%3Eand%20%3CEM%3EDescription%3C%2FEM%3E%20for%20the%20script%20and%20click%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EEnter%20the%20script%20details%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3ESelect%20the%20%3CSTRONG%3E~%2FDownloads%2FInstallGimp.sh%3C%2FSTRONG%3E%20script%20file%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CSTRONG%3ERun%20script%20as%20signed%20in%20user%3A%20No%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EHide%20script%20notification%20on%20devices%3A%20%3CSTRONG%3EYes%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EScript%20frequency%3A%20%3CSTRONG%3EEvery%201%20day%3C%2FSTRONG%3E%20(this%20is%20to%20handle%20updates%2C%20more%20on%20this%20later)%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ENumber%20of%20times%20to%20retry%20if%20script%20fails%3A%20%3CSTRONG%3E3%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3E%3CSTRONG%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275841i4A8FB3DE4A8DC98D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-5.png%22%20alt%3D%22Example%20script%20properties%20for%20macOS%20scripts%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20script%20properties%20for%20macOS%20scripts%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EClick%20%3CSTRONG%3ENext%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3EAssign%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Ffundamentals%2Fscope-tags%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EScope%20Tags%3C%2FA%3E%20if%20you%20need%20them%2C%20click%20%3CSTRONG%3ENext%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3EUnder%20Required%20click%20%3CSTRONG%3EAdd%20group%3C%2FSTRONG%3E%20and%20search%20for%20an%20appropriate%20group%20to%20target%20the%20script%20to.%20%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20At%20this%20stage%20a%20test%20group%20would%20probably%20be%20wise.%3C%2FLI%3E%0A%3CLI%3EClick%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%2C%20review%20and%20then%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E%20to%20complete%20the%20assignment.%3CBR%20%2F%3E%3CBR%20%2F%3ENext%2C%20we%20need%20to%20find%20a%20test%20device%20that%20we%20can%20use%20to%20check%20the%20deployment%20on.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIdentify%20a%20test%20device%20that%20is%20enrolled%20into%20Intune%20as%20a%20user%20in%20the%20group%20that%20you%20assigned%20the%20script%20to.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EOn%20that%20device%20press%20%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ESpace%3C%2FSTRONG%3E%20and%20type%20%E2%80%98%3CSTRONG%3ECompany%20Portal%3C%2FSTRONG%3E%E2%80%99%20and%20press%20Enter.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIf%20prompted%2C%20click%20Sign%20In%20and%20enter%20the%20users%E2%80%99%20credentials.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIn%20the%20Company%20Portal%20app%2C%20press%20%3CSTRONG%3EOption%3C%2FSTRONG%3E%2B%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ES%3C%2FSTRONG%3E%20to%20trigger%20a%20device%20check-in.%20Note%2C%20doing%20this%20on%20the%20device%20via%20Company%20Portal%20calls%20the%20script%20agent%20to%20check-in.%20Also%2C%20if%20you%20do%20this%20from%20the%20Microsoft%20Endpoint%20Manager%20admin%20center%2C%20%3C%2FSPAN%3E%3CSPAN%3Ethe%20script%20agent%20%3CU%3Ewill%20not%3C%2FU%3E%20check-in%20at%20the%20same%20time.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20final%20step%20on%20the%20client%20Mac%20is%20to%20check%20that%20the%20app%20has%20installed%2C%20and%20we%20can%20launch%20it.%20Press%20%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ESpace%3C%2FSTRONG%3E%20and%20type%20%22%3CSTRONG%3EGimp%22%3C%2FSTRONG%3E%26nbsp%3Band%20press%20Enter.%20The%20Gimp%20app%20should%20launch.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-6.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275844i67374E671078BEFA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-6.png%22%20alt%3D%22Example%20of%20launching%20the%20Gimp%20app%20to%20validate%20app%20installation%20on%20a%20macOS%20device%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20of%20launching%20the%20Gimp%20app%20to%20validate%20app%20installation%20on%20a%20macOS%20device%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAt%20this%20stage%20we%E2%80%99re%20happy%20that%20the%20script%20deploys%20the%20app%20successfully.%20All%20that%20is%20left%20is%20to%20set%20the%20assignment%20policy%20of%20the%20script%20to%20include%20all%20the%20users%20that%20you%20need%20to%20install%20the%20Gimp%20app%20to.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1558895672%22%20id%3D%22toc-hId-1558894898%22%3E%3CSPAN%3EHandling%20version%20updates%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3ESome%20apps%20handle%20updates%20automatically%20and%20some%20apps%20don%E2%80%99t.%20For%20this%20example%2C%20Gimp%20doesn%E2%80%99t%20automatically%20update%20so%20we%E2%80%99re%20going%20to%20need%20to%20handle%20that.%20Luckily%2C%20the%20example%20script%20already%20handles%20updates%20so%20all%20that%20we%20need%20to%20do%20is%20to%20upload%20a%20newer%20version%20of%20gimp.dmg%20to%20Blob%20storage%20or%20change%20the%20URL%20in%20the%20script%20to%20a%20newer%20version%20on%20the%20Gimp%20website.%20It%E2%80%99s%20really%20that%20simple.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20more%20detail%2C%20when%20we%20created%20our%20script%20policy%20in%20Intune%2C%20we%20set%20the%20schedule%20to%20run%20every%20day.%20To%20prevent%20the%20script%20from%20installing%20Gimp%20every%20time%20it%20runs%2C%20there%20are%20a%20few%20functions%20to%20handle%20updates%20and%20downloads.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EupdateCheck()%3CBR%20%2F%3E%3C%2FSPAN%3EThis%20function%20first%20checks%20the%20%3CEM%3Eautoupdate%3C%2FEM%3E%20variable.%20If%20set%20to%20true%20and%20the%20app%20is%20already%20installed%2C%20the%20script%20exits%2C%20If%20set%20to%20false%20it%20compares%20the%20%3CEM%3Elast-modified%3C%2FEM%3E%20http%20header%20of%20the%20file%20that%20we%20downloaded%20to%20install%20last%20time%20against%20the%20current%20%3CEM%3Elast-modified%20%3C%2FEM%3Edate%20of%20the%20download%20URL.%20If%20the%20dates%20are%20the%20same%2C%20the%20script%20drops%20out%20with%20nothing%20to%20do.%20If%20they%20are%20different%2C%20the%20script%20will%20attempt%20to%20download%20and%20install%20the%20update.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EwaitForProcess()%3CBR%20%2F%3E%3C%2FSPAN%3EThis%20function%20is%20called%20just%20before%20the%20app%20is%20installed.%20It%20pauses%20the%20script%20while%20the%20given%20process%20is%20running.%20If%20the%20app%20is%20running%20the%20script%20will%20wait%20until%20it%20is%20closed%20by%20the%20end%20user.%20The%20end%20user%20is%20not%20prompted%2C%20the%20script%20will%20run%20silently%20in%20the%20background.%20If%20you%20set%20terminateprocess%3D%22true%22%20the%20function%20will%20attempt%20to%20terminate%20the%20app.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20see%20these%20functions%20in%20action%20simply%20by%20running%20the%20script%20twice.%20On%20a%20test%20machine%2C%20if%20we%20download%20installGimp.sh%20and%20run%20it%20twice%2C%20on%20the%20second%20time%20through%20we%E2%80%99ll%20see%20the%20following%20log%20entry.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3ENeils-MacBook-Pro%3AGimp%20%25%20%25%20sudo%20.%2FinstallGimp.sh%20%0A%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%23%20Tue%20%206%20Apr%202021%2014%3A46%3A09%20BST%20%7C%20Logging%20install%20of%20%5BGimp%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.log%5D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%0ATue%20%206%20Apr%202021%2014%3A46%3A09%20BST%20%7C%20Checking%20if%20we%20need%20Rosetta%202%20or%20not%0ATue%20%206%20Apr%202021%2014%3A46%3A09%20BST%20%7C%20%5BIntel(R)%20Core(TM)%20i9-9880H%20CPU%20%40%202.30GHz%5D%20found%2C%20Rosetta%20not%20needed%0ATue%20%206%20Apr%202021%2014%3A46%3A09%20BST%20%7C%20Checking%20if%20we%20need%20to%20install%20or%20update%20%5BGimp%5D%0ATue%20%206%20Apr%202021%2014%3A46%3A09%20BST%20%7C%20%5BGimp%5D%20already%20installed%2C%20let's%20see%20if%20we%20need%20to%20update%0ATue%20%206%20Apr%202021%2014%3A46%3A10%20BST%20%7C%20No%20update%20between%20previous%20%5BTue%2C%2006%20Apr%202021%2012%3A03%3A05%20GMT%5D%20and%20current%20%5BTue%2C%2006%20Apr%202021%2012%3A03%3A05%20GMT%5D%0ATue%20%206%20Apr%202021%2014%3A46%3A10%20BST%20%7C%20Exiting%2C%20nothing%20to%20do%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20see%20from%20the%20log%20that%20there%20has%20been%20no%20update%20and%20so%20the%20script%20doesn%E2%80%99t%20re-install%20Gimp.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20show%20the%20update%20process%20working%2C%20update%20the%20gimp.dmg%20file%20in%20Azure%20Blob%20storage.%20Repeat%20steps%201%20and%202%20above.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EDownload%20the%20application%20DMG.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EUpload%20the%20DMG%20to%20Azure%20Blob%20storage.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EDuring%20step%202%2C%20make%20sure%20that%20you%20use%20the%20same%20file%20name%20and%20that%20you%20check%20the%20%3CEM%3EOverwrite%20if%20files%20already%20exist%3C%2FEM%3E%20checkbox.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-7.png%22%20style%3D%22width%3A%20429px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275845i661234BE7DCBA989%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-7.png%22%20alt%3D%22Screenshot%20of%20the%20Overwrite%20if%20files%20already%20exist%20checkbox%20option%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EScreenshot%20of%20the%20Overwrite%20if%20files%20already%20exist%20checkbox%20option%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOnce%20the%20upload%20is%20complete%2C%20re-run%20the%20script%20on%20the%20test%20device.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3ENeils-MacBook-Pro%3AGimp%20%25%20sudo%20.%2FinstallGimp.sh%20%0A%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%23%20Tue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Logging%20install%20of%20%5BGimp%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.log%5D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Checking%20if%20we%20need%20Rosetta%202%20or%20not%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20%5BIntel(R)%20Core(TM)%20i9-9880H%20CPU%20%40%202.30GHz%5D%20found%2C%20Rosetta%20not%20needed%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Checking%20if%20we%20need%20to%20install%20or%20update%20%5BGimp%5D%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20%5BGimp%5D%20already%20installed%2C%20let's%20see%20if%20we%20need%20to%20update%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Update%20found%2C%20previous%20%5BTue%2C%2006%20Apr%202021%2012%3A03%3A05%20GMT%5D%20and%20current%20%5BTue%2C%2006%20Apr%202021%2014%3A04%3A10%20GMT%5D%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Starting%20downlading%20of%20%5BGimp%5D%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Waiting%20for%20other%20Curl%20processes%20to%20end%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20No%20instances%20of%20Curl%20found%2C%20safe%20to%20proceed%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Octory%20found%2C%20attempting%20to%20send%20status%20updates%0ATue%20%206%20Apr%202021%2015%3A05%3A23%20BST%20%7C%20Updating%20Octory%20monitor%20for%20%5BGimp%5D%20to%20%5Binstalling%5D%0ATue%20%206%20Apr%202021%2015%3A05%3A24%20BST%20%7C%20Downloading%20Gimp%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Downloaded%20%5BGimp.app%5D%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Checking%20if%20the%20application%20is%20running%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20%5BGimp%5D%20isn't%20running%2C%20lets%20carry%20on%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Installing%20%5BGimp%5D%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Octory%20found%2C%20attempting%20to%20send%20status%20updates%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Updating%20Octory%20monitor%20for%20%5BGimp%5D%20to%20%5Binstalling%5D%0ATue%20%206%20Apr%202021%2015%3A06%3A00%20BST%20%7C%20Mounting%20%5B%2Ftmp%2Fgimp.dmg%5D%20to%20%5B%2Ftmp%2FGimp%5D%0ATue%20%206%20Apr%202021%2015%3A06%3A21%20BST%20%7C%20Copying%20%2Ftmp%2FGimp%2F*.app%20to%20%2FApplications%2FGimp.app%0ATue%20%206%20Apr%202021%2015%3A15%3A43%20BST%20%7C%20Un-mounting%20%5B%2Ftmp%2FGimp%5D%0ATue%20%206%20Apr%202021%2015%3A15%3A44%20BST%20%7C%20%5BGimp%5D%20Installed%0ATue%20%206%20Apr%202021%2015%3A15%3A44%20BST%20%7C%20Cleaning%20Up%0ATue%20%206%20Apr%202021%2015%3A15%3A44%20BST%20%7C%20Fixing%20up%20permissions%0ATue%20%206%20Apr%202021%2015%3A15%3A46%20BST%20%7C%20Application%20%5BGimp%5D%20succesfully%20installed%0ATue%20%206%20Apr%202021%2015%3A15%3A46%20BST%20%7C%20Writing%20last%20modifieddate%20%5BTue%2C%2006%20Apr%202021%2014%3A04%3A10%20GMT%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.meta%5D%0ATue%20%206%20Apr%202021%2015%3A15%3A46%20BST%20%7C%20Octory%20found%2C%20attempting%20to%20send%20status%20updates%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--248558791%22%20id%3D%22toc-hId--248559565%22%3EAdapting%20the%20example%20script%20to%20something%20else%3A%20Yammer%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EWe%20have%20our%20Gimp%20script%20working%20as%20we%20want%2C%20but%20what%20about%20other%20installer%20files%3F%20In%20this%20example%2C%20we%20are%20going%20to%20look%20at%20modifying%20the%20InstallGimp.sh%20script%20to%20handle%20Yammer%2C%20which%20is%20also%20provided%20as%20a%20DMG%20file.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20completed%20script%20for%20Yammer%20is%20available%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Ftree%2Fmaster%2FApps%2FYammer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20If%20we%20look%20at%20a%20comparison%20of%20changes%20between%20the%20installGimp.sh%20and%20installYammer.sh%20scripts%2C%20we%20can%20see%20that%20the%20only%20differences%20are%20on%20lines%2021-27.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-8.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275846i0BE5508C5FB41195%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-8.png%22%20alt%3D%22Comparison%20of%20changes%20between%20the%20installGimp.sh%20and%20installYammer.sh%20scripts%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EComparison%20of%20changes%20between%20the%20installGimp.sh%20and%20installYammer.sh%20scripts%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20changes%20on%20line%206%20are%20just%20a%20description%20of%20the%20script.%20Lines%2020-27%20are%20variables%20that%20are%20discussed%20in%20more%20detail%20in%20Step%203%20above.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20User%20Defined%20variables%0Aweburl%3D%22https%3A%2F%2Faka.ms%2Fyammer_desktop_mac%22%0Aappname%3D%22Yammer%22%0Aapp%3D%22Yammer.app%22%0Alogandmetadir%3D%22%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallYammer%22%0Aprocesspath%3D%22%2FApplications%2FYammer.app%2FContents%2FMacOS%2FYammer%22%0Aterminateprocess%3D%22false%22%0AautoUpdate%3D%E2%80%9Dfalse%E2%80%9D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%26nbsp%3BThat%20in%20this%20example%20we%20are%20not%20using%20Azure%20blob%20storage%20but%20the%20normal%20download%20URL%20for%20Yammer.%20After%20editing%20the%20script%20we%20then%20follow%20the%20steps%20in%20Step%204%20-%20Deploy%20the%20bash%20script%20via%20the%20Intune%20scripting%20agent%20above.%20Once%20deployed%2C%20we%20can%20go%20to%20the%20Mac%20and%20trigger%20a%20manual%20check-in%20and%20then%20check%20the%20logs%20on%20our%20target%20Mac.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFor%20Yammer%2C%20our%20new%20policy%20ID%20is%3A%20%3CSTRONG%3E010f31ef-1cfc-441b-a409-fc75e838c5d0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFrom%20the%20IntuneMDMDaemon*.log%20file%20we%20see%20the%20following%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EIntuneMDM-Daemon%20%7C%20I%20%7C%20*10068%20%7C%20ScriptPolicyHandler%20%7C%20Running%20script%20policy%20PolicyID%3A%20010f31ef-1cfc-441b-a409-fc75e838c5d0%0AIntuneMDM-Daemon%20%7C%20I%20%7C%20*10068%20%7C%20ScriptPolicyHandler%20%7C%20Delivering%20user%20notification.%20PolicyID%3A%20010f31ef-1cfc-441b-a409-fc75e838c5d0%2C%20BlockExecutionNotifications%3A%20true%0AIntuneMDM-Daemon%20%7C%20I%20%7C%2012959%20%7C%20ScriptPolicyHandler%20%7C%20Script%20ran%20PolicyID%3A%20010f31ef-1cfc-441b-a409-fc75e838c5d0%2C%20TotalRetries%3A%200%2C%20Status%3A%20Success%2C%20ExitCode%3A%200%0AIntuneMDM-Daemon%20%7C%20I%20%7C%2012959%20%7C%20ScriptPolicyHandler%20%7C%20Script%20policy%20succeeded%20PolicyID%3A%20010f31ef-1cfc-441b-a409-fc75e838c5d0%2C%20TotalRetries%3A%200%2C%20ExitCode%3A%200%0AIntuneMDM-Daemon%20%7C%20I%20%7C%2012959%20%7C%20ScriptPolicyHandler%20%7C%20Adding%20script%20to%20scheduler%20PolicyID%3A%20010f31ef-1cfc-441b-a409-fc75e838c5d0%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAnd%20from%20the%20%3CSTRONG%3E%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallYammer%2FYammer.log%3C%2FSTRONG%3E%20we%20see%20the%20following%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3ESat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Creating%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallYammer%5D%20to%20store%20logs%0A%20%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%23%20Sat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Logging%20install%20of%20%5BYammer%5D%20to%20%5B%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallYammer%2FYammer.log%5D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%20%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Checking%20if%20we%20need%20Rosetta%202%20or%20not%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Waiting%20for%20other%20%5B%2Fusr%2Fsbin%2Fsoftwareupdate%5D%20processes%20to%20end%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20No%20instances%20of%20%5B%2Fusr%2Fsbin%2Fsoftwareupdate%5D%20found%2C%20safe%20to%20proceed%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20%5BIntel(R)%20Core(TM)%20i9-9880H%20CPU%20%40%202.30GHz%5D%20found%2C%20Rosetta%20not%20needed%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Checking%20if%20we%20need%20to%20install%20or%20update%20%5BYammer%5D%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20%5BYammer%5D%20not%20installed%2C%20need%20to%20download%20and%20install%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Dock%20is%20here%2C%20lets%20carry%20on%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Starting%20downlading%20of%20%5BYammer%5D%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Waiting%20for%20other%20%5Bcurl%5D%20processes%20to%20end%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20No%20instances%20of%20%5Bcurl%5D%20found%2C%20safe%20to%20proceed%0ASat%2010%20Apr%202021%2017%3A38%3A30%20BST%20%7C%20Downloading%20Yammer%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Unknown%20file%20type%20%5B%2Fvar%2Ffolders%2Fzz%2Fzyxvpxvq6csfxvn_n0000000000000%2FT%2Ftmp.U6LKs7Fb%2Fyammer_desktop_mac%5D%2C%20analysing%20metadata%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Downloaded%20%5BYammer.app%5D%20to%20%5B%2Fvar%2Ffolders%2Fzz%2Fzyxvpxvq6csfxvn_n0000000000000%2FT%2Ftmp.U6LKs7Fb%2Finstall.dmg%5D%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Detected%20install%20type%20as%20%5BDMG%5D%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Waiting%20for%20other%20%5B%2FApplications%2FYammer.app%2FContents%2FMacOS%2FYammer%5D%20processes%20to%20end%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20No%20instances%20of%20%5B%2FApplications%2FYammer.app%2FContents%2FMacOS%2FYammer%5D%20found%2C%20safe%20to%20proceed%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Installing%20%5BYammer%5D%0ASat%2010%20Apr%202021%2017%3A38%3A49%20BST%20%7C%20Mounting%20Image%0ASat%2010%20Apr%202021%2017%3A38%3A56%20BST%20%7C%20Copying%20app%20files%20to%20%2FApplications%2FYammer.app%0ASat%2010%20Apr%202021%2017%3A39%3A14%20BST%20%7C%20Un-mounting%20%5B%2Fvar%2Ffolders%2Fzz%2Fzyxvpxvq6csfxvn_n0000000000000%2FT%2Ftmp.U6LKs7Fb%2FYammer%5D%0ASat%2010%20Apr%202021%2017%3A39%3A14%20BST%20%7C%20%5BYammer%5D%20Installed%0ASat%2010%20Apr%202021%2017%3A39%3A14%20BST%20%7C%20Cleaning%20Up%0ASat%2010%20Apr%202021%2017%3A39%3A14%20BST%20%7C%20Fixing%20up%20permissions%0ASat%2010%20Apr%202021%2017%3A39%3A14%20BST%20%7C%20Application%20%5BYammer%5D%20succesfully%20installed%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20validate%20the%20installation%2C%20launch%20the%20Yammer%20app%20by%20pressing%20%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ESpace%3C%2FSTRONG%3E%20and%20typing%20%22%3CSTRONG%3EYammer%22%3C%2FSTRONG%3E%26nbsp%3Band%20then%20Enter.%20Assuming%20everything%20works%20as%20expected%2C%20the%20next%20step%20is%20to%20repeat%20step%204%20above%20(Deploy%20the%20bash%20script%20with%20Intune%20Scripting%20Agent)%20and%20assign%20it%20to%20your%20users.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--2056013254%22%20id%3D%22toc-hId--2056014028%22%3E%3CSPAN%3EWhat%20about%20other%20package%20types%3F%20APP%20or%20PKG%3F%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EThis%20approach%20can%20be%20used%20for%20any%20macOS%20installer%20that%20can%20be%20triggered%20from%20the%20shell.%20The%20script%20attempts%20to%20determine%20the%20correct%20installer%20type%20from%20the%20downloaded%20file.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EMore%20examples%20using%20the%20same%20script%20can%20be%20found%20here%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fblob%2Fmaster%2FApps%2FCompany%2520Portal%2FinstallCompanyPortal.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Company%20Portal%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fblob%2Fmaster%2FApps%2FRemote%2520Desktop%2FinstallRemoteDesktop.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Remote%20Desktop%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fblob%2Fmaster%2FApps%2FgitHub%2520Desktop%2FinstallGitHubDesktop.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%20Desktop%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fblob%2Fmaster%2FApps%2FVisual%2520Studio%2520Code%2FinstallVSCode.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EVisual%20Studio%20Code%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fblob%2Fmaster%2FApps%2FZoom%2FinstallZoom.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EZoom%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20best%20way%20to%20get%20started%20is%20to%20download%20one%20of%20the%20example%20scripts%20and%20modify%20it%20for%20your%20application.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ESome%20of%20the%20examples%20use%20weburls%20on%20Azure%20blob%20storage%20and%20others%20pull%20directly%20from%20the%20source%20download%20sites%20(like%20Company%20Portal).%20The%20script%20uses%20%3CSTRONG%3Ecurl%20-OJL%20%3CURL%3E%3C%2FURL%3E%3C%2FSTRONG%3E%20to%20download%20the%20installer%20and%20create%20the%20temp%20file.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%20If%20the%20app%20you%20are%20trying%20to%20deploy%20is%20provided%20to%20you%20as%20an%20.app%20file%2C%20you%20can%20compress%20the%20app%20into%20a%20ZIP%20and%20use%20the%20examples%20above.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20the%20examples%20include%20a%20function%20to%20handle%20Rosetta%202%20deployment%20for%20Apple%20Silicon%20devices.%20That%20means%20these%20scripts%20can%20be%20deployed%20straight%20to%20an%20M1%20Mac%20and%20it%20will%20automatically%20handle%20the%20installation%20of%20Rosetta%202%20so%20that%20the%20application%20can%20run.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-431499579%22%20id%3D%22toc-hId-431498805%22%3ETroubleshooting%3C%2FH3%3E%0A%3CP%3E%3CSTRONG%3EUsing%20Microsoft%20Endpoint%20Manager%20admin%20center%3C%2FSTRONG%3E%3CBR%20%2F%3EIntune%20also%20reports%20the%20status%20of%20each%20script%20in%20the%20UI.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EOpen%20the%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMEMAC%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Endpoint%20Manager%20admin%20center%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20%3CSTRONG%3EDevices%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EmacOS%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EShell%20scripts%3C%2FSTRONG%3E%20and%20select%20the%20script%20you%20want%20to%20troubleshoot.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20on%20%3CSTRONG%3EDevice%20Status%3C%2FSTRONG%3E%20and%20then%20select%20the%20device%20you%20are%20troubleshooting.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20on%20%3CSTRONG%3EShow%20details%3C%2FSTRONG%3E%20and%20Intune%20will%20display%20the%20last%20output%20from%20the%20script.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-9.png%22%20style%3D%22width%3A%20741px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275848i9548883DD4C8E640%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-9.png%22%20alt%3D%22Example%20screenshot%20of%20the%20GIMP%20app%20Device%20status%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20the%20GIMP%20app%20Device%20status%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3EIf%20we%20need%20more%20information%2C%20we%20can%20use%20the%20Intune%20script%20agent%20to%20gather%20logs%20from%20the%20Mac%20for%20us%20remotely.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20on%20%3CSTRONG%3ECollect%20Logs%3C%2FSTRONG%3E%20and%20enter%20in%20the%20name%20of%20the%20log%20file%20you%20want%20to%20retrieve.%20In%20our%20example%20that%20is%20%3CSTRONG%3E%2FLibrary%2FLogs%2FMicrosoft%2FIntuneScripts%2FinstallGimp%2FGimp.log%3C%2FSTRONG%3E.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-10.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275849i2EEB5568D24D52E9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-10.png%22%20alt%3D%22Example%20screenshot%20of%20collecting%20logs%20with%20the%20GIMP%20application%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20collecting%20logs%20with%20the%20GIMP%20application%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CSPAN%3EThe%20next%20time%20that%20the%20script%20agent%20checks%20in%20(8%20hour%20cycle)%2C%20the%20logs%20will%20be%20returned%20to%20Intune.%20You%20can%20force%20this%20by%20having%20the%20end%20user%20open%20Company%20Portal%20and%20clicking%20%3CSTRONG%3ECheck%3C%2FSTRONG%3E%20%3CSTRONG%3ESettings%3C%2FSTRONG%3E.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CP%3E%3CSTRONG%3E%3CSPAN%3ENote%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3A%20On%20the%20device%2C%20in%20the%20IntuneMDMDaemon%20log%20file%20you%20can%20see%20log%20upload%20requests%20and%20completions%20by%20searching%20for%20%22LogUploadResultItem%22.%3C%2FSPAN%3E%3C%2FP%3E%3CSPAN%3E%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EIntuneMDM-Daemon%20%7C%20I%20%7C%20255380%20%7C%20PersistenceManager%20%7C%20Storing%20LogUploadResultItem%0AIntuneMDM-Daemon%20%7C%20I%20%7C%20256078%20%7C%20PersistenceManager%20%7C%20Getting%20all%20LogUploadResultItem%0AIntuneMDM-Daemon%20%7C%20I%20%7C%20*235677%20%7C%20PersistenceManager%20%7C%20Deleting%20all%20LogUploadResultItem%0AIntuneMDM-Daemon%20%7C%20I%20%7C%20256953%20%7C%20PersistenceManager%20%7C%20Getting%20all%20LogUploadResultItem%3C%2FCODE%3E%3C%2FPRE%3E%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3B%3CSPAN%3EOnce%20the%20logs%20have%20been%20returned%2C%20the%20%3CSTRONG%3EDownload%20logs%3C%2FSTRONG%3E%20button%20will%20be%20shown.%20Click%20this%20to%20download%20the%20device%20logs%20as%20a%20zip%20file.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-11.png%22%20style%3D%22width%3A%20699px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275851iA2A1F651FAF12CF9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-11.png%22%20alt%3D%22Example%20screenshot%20of%20the%20%26quot%3BDownload%20logs%26quot%3B%20button%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20the%20%22Download%20logs%22%20button%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EInside%20the%20zip%20file%20will%20be%20the%20file%20we%20requested%2C%20plus%20the%20two%20Intune%20script%20agent%20(user)%20and%20daemon%20(root)%20logs%2C%20which%20are%20always%20returned.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-12.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275852i64F1E3493E12C0C9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-12.png%22%20alt%3D%22Example%20screenshot%20of%20the%20Downloaded%20logs%20from%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20the%20Downloaded%20logs%20from%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20make%20sense%20of%20the%20logs%2C%20it%E2%80%99s%20useful%20to%20know%20the%20policy%20ID%20of%20the%20script%20we%20are%20troubleshooting.%20We%20can%20get%20this%20from%20the%20Microsoft%20Endpoint%20Manager%20admin%20center.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EOpen%20the%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMEMAC%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Endpoint%20Manager%20admin%20center%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20%3CSTRONG%3EDevices%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EmacOS%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EShell%20scripts%3C%2FSTRONG%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EFind%20the%20script%20in%20the%20list%20and%20click%20on%20it%2C%20make%20a%20note%20of%20the%20%3CSTRONG%3EpolicyID%3C%2FSTRONG%3E%20in%20the%20browser%20URL.%20We%20will%20use%20it%20to%20filter%20the%20log%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20my%20example%2C%20the%20URL%20is%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fendpoint.microsoft.com%2F%23blade%2FMicrosoft_Intune_DeviceSettings%2FConfigureWMPolicyMenu%2Foverview%2FpolicyId%2F7edf5358-c157-437a-8bc0-0a4889b20ae4%2FpolicyType%2F1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fendpoint.microsoft.com%2F%23blade%2FMicrosoft_Intune_DeviceSettings%2FConfigureWMPolicyMenu%2Foverview%2FpolicyId%2F7edf5358-c157-437a-8bc0-0a4889b20ae4%2FpolicyType%2F1.%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20easiest%20way%20to%20view%20the%20logs%20is%20via%20the%20Console%20app.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EPress%20%3CSTRONG%3ECMD%3C%2FSTRONG%3E%2B%3CSTRONG%3ESpace%3C%2FSTRONG%3E%20and%20type%20%E2%80%98%3CSTRONG%3EConsole%E2%80%99%3C%2FSTRONG%3E%20and%20press%20Enter%2C%20this%20will%20open%20the%20Console%20app.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20on%20%3CSTRONG%3EFile%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EOpen%3C%2FSTRONG%3E%20and%20navigate%20to%20the%20IntuneMDMDaemon*log.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EPaste%20the%20%3CSTRONG%3EpolicyID%3C%2FSTRONG%3E%20from%20step%203%20above%20into%20the%20search%20box%20and%20it%20should%20filter%20the%20log%20for%20only%20the%20lines%20referring%20to%20our%20script.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-13.png%22%20style%3D%22width%3A%20853px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275857iD8EE62B36B02639C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-13.png%22%20alt%3D%22Example%20screenshot%20of%20filtering%20out%20the%20IntuneMDMDaemon*log%20on%20a%20macOS%20device%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20filtering%20out%20the%20IntuneMDMDaemon*log%20on%20a%20macOS%20device%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20key%20things%20to%20look%20for%20in%20the%20IntuneMDMDaemon%20log%20are%20as%20follows%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ERunning%20script%3C%2FSTRONG%3E%20policy%20PolicyID%3A%207edf5358-c157-437a-8bc0-0a4889b20ae4%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EScript%20policy%20succeeded%3C%2FSTRONG%3E%20PolicyID%3A%207edf5358-c157-437a-8bc0-0a4889b20ae4%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3ENote%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3E%3A%20You%20can%20also%20view%20the%20logs%20directly%20on%20the%20Mac%20if%20you%20have%20access.%20Use%20Console%20again%20to%20view%20them.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3E%2FLibrary%2FLogs%2FMicrosoft%2FIntune%3C%2FSTRONG%3E%20%3CSPAN%3E%5BFor%20scripts%20that%20do%20not%20run%20as%20the%20end%20user%5D%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3E~%2FLibrary%2FLogs%2FMicrosoft%2FIntune%3C%2FSTRONG%3E%20%3CSPAN%3E%5BFor%20scripts%20that%20do%20run%20as%20the%20end%20user%5D%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1375954884%22%20id%3D%22toc-hId--1375955658%22%3EScript%20Log%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EThis%20is%20the%20log%20that%20is%20generated%20by%20each%20script%20so%20the%20output%20will%20be%20different%20depending%20on%20what%20you%20put%20in%20your%20script.%20The%20best%20way%20to%20view%20is%20in%20the%20Console%20app.%20Search%20for%20%E2%80%98Gimp%E2%80%99.%20The%20log%20file%20output%20should%20look%20very%20similar%20to%20the%20output%20we%20saw%20when%20we%20ran%20the%20script%20manually.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-14.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275862i9B8FD70CDED8E93F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-14.png%22%20alt%3D%22Example%20screenshot%20of%20the%20log%20output%20for%20the%20GIMP%20app%20on%20a%20macOS%20device%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20the%20log%20output%20for%20the%20GIMP%20app%20on%20a%20macOS%20device%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-416394470%22%20id%3D%22toc-hId-416393696%22%3E%3CSPAN%3EVersion%20Reporting%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EOne%20of%20the%20biggest%20problems%20with%20this%20approach%20of%20app%20deployment%20is%20that%20apps%20deployed%20in%20this%20way%20do%20not%20show%20up%20in%20the%20%E2%80%98managed%20apps%E2%80%99%20list%20for%20each%20managed%20Mac%20in%20Intune.%20To%20help%20mitigate%20this%20a%20little%2C%20we%20can%20use%20Intune%E2%80%99s%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fmacos-shell-scripts%23custom-attributes-for-macos%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecustom%20attribute%3C%2FA%3E%20feature%20to%20run%20a%20shell%20script%20on%20the%20Mac%20and%20return%20the%20version%20of%20our%20app.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20have%20an%20example%20custom%20attribute%20script%20to%20return%20the%20version%20of%20a%20Mac%20app%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%2Fraw%2Fmaster%2FCustom%2520Attributes%2FGimp%2FfetchGimpVersion.sh%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20deploy%20the%20custom%20attribute%20script%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EDownload%20the%20example%20script%20to%20%3CSTRONG%3E~Downloads%3C%2FSTRONG%3E.%20Open%20in%20Visual%20Studio%20Code%20and%20modify%2Ftest%20as%20required%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EOpen%20the%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMEMEAC%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Endpoint%20Manager%20admin%20center%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20%3CSTRONG%3EDevices%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EmacOS%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3ECustom%20attributes%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3EEnter%20a%20%3CEM%3EName%3C%2FEM%3E%20and%20%3CEM%3EDescription%3C%2FEM%3E%20for%20the%20script%20and%20click%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESet%20the%20data%20type%20of%20attribute%20to%20%3CSTRONG%3EString%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20the%20%3CSTRONG%3E~%2FDownloads%2FfetchGimpversion.sh%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAssign%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Ffundamentals%2Fscope-tags%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EScope%20Tags%3C%2FA%3E%20if%20you%20need%20them%2C%20click%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EUnder%20Required%20click%20%3CSTRONG%3EAdd%20group%3C%2FSTRONG%3E%20and%20search%20for%20an%20appropriate%20group%20to%20target%20the%20script%20to%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EClick%20%3CSTRONG%3ENext%3C%2FSTRONG%3E%2C%20review%20and%20then%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E%20to%20complete%20the%20assignment%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20next%20time%20that%20the%20Intune%20macOS%20script%20agent%20checks-in%20to%20Intune%2C%20it%20will%20run%20the%20script%20and%20return%20the%20value.%20To%20see%20a%20list%20of%20the%20returned%20values%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EOpen%20the%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMEMEAC%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Endpoint%20Manager%20admin%20center%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20%3CSTRONG%3EDevices%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3EmacOS%3C%2FSTRONG%3E%20%26gt%3B%20%3CSTRONG%3ECustom%20attributes%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESelect%20the%20custom%20attribute%20you%20created%20%26gt%3B%20%3CSTRONG%3EDevice%20Status%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22macOS%20Apps%20Blog-15.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275865iE8B45F90784FAEC8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22macOS%20Apps%20Blog-15.png%22%20alt%3D%22Example%20screenshot%20of%20the%20previously%20created%20Custom%20attributes%20in%20Intune%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExample%20screenshot%20of%20the%20previously%20created%20Custom%20attributes%20in%20Intune%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20report%20can%20be%20exported%20to%20a%20CSV%20file%20if%20required.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EObviously%2C%20this%20is%20a%20basic%20example%2C%20but%20it%20could%20be%20expanded%20to%20return%20any%20information%20that%20you%20can%20gather%20from%20a%20shell%20script.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1391059993%22%20id%3D%22toc-hId--1391060767%22%3ESummary%3C%2FH3%3E%0A%3CP%3EHopefully%20this%20blog%20and%20example%20scripts%20have%20provided%20some%20guidance%20around%20the%20possibilities%20of%20deploying%20apps%20via%20the%20Intune%20script%20agent%20and%20Azure%20Blob%20storage%20(or%20other%20web%20hosting%20sites).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20approach%20is%20especially%20useful%20for%20applications%20that%20cannot%20be%20deployed%20via%20the%20other%20App%20deployment%20scenarios%20that%20Intune%20provides.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2250%25%22%3E%3CSTRONG%3EAdvantages%3C%2FSTRONG%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2250%25%22%3EDisadvantages%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2250%25%22%3E%3CUL%3E%0A%3CLI%3EExtremely%20flexible.%3C%2FLI%3E%0A%3CLI%3ENo%20need%20for%20build%20certificate%20to%20sign%20custom%20packages.%3C%2FLI%3E%0A%3CLI%3EMore%20detailed%20logging%20capabilities.%3C%2FLI%3E%0A%3CLI%3ECan%20handle%20dependencies%20(such%20as%20Rosetta%20on%20M1%20devices).%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2250%25%22%3E%3CUL%3E%0A%3CLI%3ERequires%20some%20bash%20scripting%20skills.%3C%2FLI%3E%0A%3CLI%3EApps%20deployed%20via%20this%20method%20don%E2%80%99t%20show%20up%20in%20%22Managed%20Apps%22%20UI%20in%20Intune.%20Can%20mitigate%20this%20somewhat%20with%20%E2%80%98custom%20attributes%E2%80%99.%3C%2FLI%3E%0A%3CLI%3EThe%20scripts%20deployed%20run%20at%20%3CSTRONG%3Eyour%20own%20risk%3C%2FSTRONG%3E%20and%20you%20are%20%3CSTRONG%3Eentirely%20responsible%20for%20them%3C%2FSTRONG%3E%20and%20%3CSTRONG%3Eany%20damage%20they%20may%20do%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20on%20deploying%20scripts%20with%20Intune%20see%20our%20documentation%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Fapps%2Fmacos-shell-scripts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20We%20also%20have%20a%20broader%20set%20of%20shell%20script%20examples%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fshell-intune-samples%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIntune%20team%20GitHub%20Repository%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20us%20know%20if%20you%20have%20any%20questions%20by%20replying%20to%20this%20post%20or%20reaching%20out%20to%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FIntuneSuppTeam%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40IntuneSuppTeam%3C%2FA%3E%20on%20Twitter.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2298072%22%20slang%3D%22en-US%22%3E%3CP%3ERead%20this%20post%20to%20learn%20more%20about%20deploying%20macOS%20apps%20with%20the%20Intune%20scripting%20agent!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MTC_4kStill_01_blog.jpg%22%20style%3D%22width%3A%20294px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F275879iCC93D21716D0DC7E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MTC_4kStill_01_blog.jpg%22%20alt%3D%22MTC_4kStill_01_blog.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2298072%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntune%20Customer%20Success%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntune%20scripting%20agent%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EmacOS%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMEM%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

Version history
Last update:

‎Apr 27 2021 08:11 AM

Updated by:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK