How to deploy Files on a Mac
Deploying files to Intune-managed macOS devices can be challenging. This guide will walk you through the process of creating a .pkg application to securely deploy your files on macOS devices.
Why Use This Method?
There are several advantages to using a .pkg application for file deployment:
- No need to host files remotely or in the cloud
- No need for secrets in scripts
- Increased security compared to public endpoints or Azure Blob Storage
The main potential disadvantage is the initial setup time, which takes about 10 minutes, and the requirement of a macOS device for packaging.
Creating the PKG Application
- Create the folder structure
- Organize your folders into two main directories:
Content
andScripts
- The
Content
folder will contain the files you want to deploy - The
Scripts
folder will contain thepostinstall
script
- Organize your folders into two main directories:
- Create the postinstall script
- Place the script in the
Scripts
folder - Make it executable with:
chmod a+x postinstall
- Remove any file extensions (e.g., .sh)
- View the full postinstall script example
- Place the script in the
- Execute pkgbuild to create the .pkg file
- Run the following command in the terminal:
- Replace
com.yourdomain.yourapp
with your organization’s identifier - Replace
YourApp.pkg
with the desired name for your .pkg file
- Upload the .pkg file to Intune
- Go to the Microsoft Intune portal
- Navigate to Apps > All apps > Add
- Select Line-of-business app
- Upload your .pkg file
- Configure the app settings as needed
- Assign the app to your desired groups or users
- Deploy the app to your devices
- The app will be installed on the devices in the assigned groups or users
- The files will be deployed to the specified location on the devices