In my previous blog posts, we have walked through the steps for Enrolling a Mac device in Intune, Fix the Profile Installation Failed Error during macOS enrollment, and steps to manually sync macOS devices with Intune. In this blog post, we will explore the steps for configuring a desktop wallpaper on Intune-managed macOS devices.
Large organizations often use desktop wallpapers to convey important information to employees. This can include company achievements, recent news, policy updates etc.
Users can set their own wallpapers, but managing desktop wallpaper from a central place like Intune ensures a consistent look across all devices. Besides this, it also provides:
- Security Information: It could help organizations enforce security-related reminders and provide emergency contact information.
- Corporate Environment: Setting corporate wallpaper on all devices can foster a sense of a corporate environment. The company logo, colors, and brand on the wallpapers can show the company’s Identity. It also helps the clients and visitors showcase the brand.
We will use the shell scripts provided by Microsoft to deploy custom wallpaper on Mac devices. For this, we would need a Wallpaper in PNG, JPG, or JPEG file/format stored in a publicly accessible location.
To securely store the wallpaper that is publicly accessible, you can create an Azure Storage container. You can also use other locations, such as SharePoint Online or Dropbox.
Contents
1. Copy Wallpapers to a Publicly Accessible Location
Desktop wallpaper file should be publicly accessible or at least accessible from the target devices. You can store these files at any location which is accessible over the internet. I would be using an Azure storage container. Let’s take a look:
To create a storage account using the Microsoft Azure portal, search for Storage account and select the Create option. Then, fill in the necessary details to complete the storage account creation process.
After creating an Azure Storage account, you can set up a container by navigating to the storage account, selecting Containers, and then clicking + Container.
Provide a name for the container and set the Public access level to Blob (anonymous read access for blobs only). This ensures that the wallpapers stored in this container can be publicly accessed. Upload desktop wallpaper to this location.
- Click on the file to copy the URL. You can test to confirm if the URL is publicly accessible by opening an Incognito browser mode and pasting the URL in the address bar and press Enter.
- https://cloudinfrasa01.blob.core.windows.net/wallpapers/CloudInfra-desktopwall.jpg
2. Download Scripts from GitHub
The next step is to download Microsoft-provided scripts from GitHub, which are required for updating the desktop wallpaper on Mac devices.
- Go to the link: Desktop Wallpaper macOS Scripts and download downloadWallpaper.sh and wallpaper.mobileconfig files on your device.
3. Update Scripts files
- downloadWallpaper.sh: This script downloads the wallpaper file on your Mac.
- wallpaper.mobileconfig: This config file Instructs the Mac to change the wallpaper image to the downloaded wallpaper.
3.1. Update downloadWallpaper.sh file
Open downloadWallpaper.sh shell script in a notepad and update below values:
- Update the wallpaperurl variable and set it to the location of the wallpaper.
- Update wallpaperfile variable to match the wallpaper file name stored in the Azure blob container.
- Update usebingwallpaper variable value to false.
- Save the changes.
3.2. Update wallpaper.mobileconfig file
- Update the key value for override-picture-path to point to the location of the downloaded wallpaper. For example: /Library/Desktop/CloudInfra-desktopwall.jpg.
- Save the changes.
4. Deploy downloadWallpaper.sh Shell Script
Now, let’s create a deployment in the Intune admin center to deploy the downloadWallpaper.sh shell script to macOS devices. When this script runs on the targeted device, it will download the wallpaper from the Azure container to the desktop of targeted Mac. Let’s go through the steps:
- Sign in to the Intune admin center > Devices > macOS.
- Click on Shell scripts under macOS policies.
- Click on + Add to Add the script for deployment.
- Basics Tab: Provide a name and description of this deployment. Click on Next to proceed.
- Script settings: To upload the script, click the blue folder icon and select the downloadWallpaper.sh file.
- Run script as signed-in user: No (Script will run using root privileges)
- Hide script notifications on devices: Yes (Notifications will not be shown to the users)
- Script frequency: Every 15 minutes (As I am currently testing this on a test macOS device, I have kept the Script frequency at 15 minutes. But once the test is completed successfully, you can change the script frequency to Every 1 day or Every 1 week).
- Number of times to retry if script fails : 3 (If script deployment fails, it will be tried 2 more times)
- Assignments: Click on Add groups to add an Entra security group containing macOS devices. Click Next to continue.
- Review + add: Review the deployment and click Add.
For more information about Shell script deployment on macOS devices via Intune, refer to the post: Deploy Shell Scripts on macOS using Intune.
Shell script deployment on macOS via Intune
5. Deploy wallpaper.mobileconfig file
Next step is to create a Device configuration profile using Custom template and apply the desktop wallpaper using wallpaper.mobileconfig configuration file.
In the previous step, we downloaded the wallpaper on the device. This step which uses wallpaper.mobileconfig file, will set macOS desktop wallpaper to the downloaded wallpaper.
- Sign in to the Intune admin center > Devices > Configuration > Create > New Policy.
- Platform: macOS
- Profile type: Templates
- Template name: Custom
- Basics Tab: Provide a name and description of this deployment. Click on Next to proceed.
- Configuration settings:
- Custom configuration profile name: Apply Desktop Wallpaper on macOS devices
- Deployment channel: Device channel
- Configuration profile file: Browse to select wallpaper.mobileconfig file.
- Assignments: We can use the same Entra security group which was used to deploy downloadWallpaper.sh shell script. Click on Add groups and select th group.
- Review + create: Review the deployment and click on Create.
Sync Intune Policies
The device check-in process might not begin immediately. If you’re testing this policy on a test device, you can manually kickstart Intune sync from the device itself or remotely through the Intune admin center.
Alternatively, you can use PowerShell to force the Intune sync on Windows devices. Restarting the device is another way to trigger the Intune device check-in process.
End User Experience
Once the deployment is completed, Use the following steps to check and confirm if the desktop wallpaper has been downloaded and
- Go to Finder App > Go > Go to Folder.
- Search for /library/desktop path.
- Double-click on it to open.
- As shown in the below screenshot, the wallpaper has been successfully downloaded and is now available on the desktop.
- After a few minutes, a new wallpaper will be automatically set on the macOS device as the configuration profile takes effect.
FAQs
1. Wallpaper file is not getting downloaded on macOS device
After deploying the shell script downloadWallpaper.sh, I tried to check if the wallpaper file has been downloaded on the device. I checked the location /library/desktop but could not find the wallpaper file.
This could be because of one of the two reasons. First reason could be that the usebingwallpaper value is set to true. The Second possible reason could be that you are looking in the wrong place for the downloaded wallpaper. The wallpaper is downloaded to the /Library/Desktop location, not the user profile’s desktop location.
When the usebingwallpaper value is true, the wallpaper stored in the Azure blob container will not be downloaded. Instead, a Bing wallpaper will be downloaded, and the file name will be the same as the one in your Azure blob container. Therefore, ensure that usebingwallpaper is set to false so that custom wallpaper stored in Azure container could be downloaded.
2. Troubleshooting Wallpaper Deployment Issues using Logs
If for some reason the desktop wallpaper is not applied on your target Mac devices. You can check the logs and find out the root cause. There are two log files you can check, first one is fetchdesktopwallpaper.log file, and the second is the IntuneMDMDaemon xxxxxxx.log file. To locate and open these files, you can check below steps:
2.1 fetchdesktopwallpaper.log file
- Go to Finder App > Go > Go to Folder.
- Type /var/log/fetchdesktopwallpaper.log.
- Double-click on it to open; this will open the log explorer window.
- Double-click on fetchdesktopwallpaper.log file to check the logs.
2.2 IntuneMDMDaemon xxxxxxx.log file
- Go to Finder App > Go > Go to Folder.
- Type /Library/Logs/Microsoft/Intune.
- Double-click on it to open, this will open Intune folder.
- Double-click on IntuneMDMDaemon xxxxxxx.log file to check the logs.
- You can also open Harddisk Drive Explorer on macOS and browse to /Library/Logs/Microsoft/Intune path to check for the log file.
macOS Intune Troubleshooting
If you encounter any issues with application deployment, you can refer to the IntuneMDMDaemon*.log and IntuneMDMAgent*.log files. For more information about how to locate these files on a macOS device, see my other blog post, Collect Intune Logs From MacOS Device.
Conclusion
In this blog post, we’ve learned to set desktop wallpaper on macOS devices using Intune. You can easily update the company desktop wallpaper on all macOS devices by replacing the wallpaper file in the Azure storage container. The location of this container is configured in the downloadwallpaper.sh file.
Hi Jatin,
Is there a way to modify the mobileconfig file to allow users to change the wallpaper after you’ve deployed it? I want to have our wallpaper as the default, out of the box experience, but I would like to allow users to change it.
Hey Tom, Could be possible to tweak the mobileconfig file, I have not looked into this yet. I will check and get back to you.
I wonder if it is possible to do this with login screen wallpaper too.