How to Set Desktop Wallpaper on macOS using Intune

In my previous blog posts, we discussed how to Enroll a Mac device into Intune, Fix the Profile Installation Failed Error during macOS enrollment, and manually sync macOS devices with Intune. In the upcoming sections of the blog post, we will explore the steps of 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, and more, ensuring effective communication with the workforce.

Users can set wallpapers on their devices, but central management ensures a consistent look and benefits such as branding consistency, security, information communication, and ease of support.

  • Security Information: Managing desktop wallpaper could help organizations enforce security-related reminders and provide emergency contact information.
  • Corporate Environment: Setting a specific wallpaper on all desktop and laptop devices can foster a sense of a Corporate Environment. The company logo, colors, and brand on the desktop wallpaper can show the company’s Identity. Also helps the Clients and Visitors to showcase the brand.

Applying a Desktop wallpaper on macOS devices using Intune is a 2-Step process:

  1. Deploy a Shell script downloadWallpaper.sh, which will download your custom wallpaper on a macOS device
  2. Create a Custom Device configuration profile to deploy the wallpaper.mobileconfig file, which will update the wallpaper on macOS.

What do we need?

  • A Wallpaper is a 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. However, you can also use other locations, such as SharePoint Online or Dropbox, if they provide public accessibility.

How to set Desktop and Lock Screen Wallpaper using Intune [On Windows devices]

Step-by-Step Guide

Step 1 – Copy wallpapers to a publicly accessible location

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.
Azure Storage blob / container with desktop wallpaper for macOS
Azure Storage blob / container with desktop wallpaper for macOS
  • 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.
    • https://cloudinfrasa01.blob.core.windows.net/wallpapers/CloudInfra-desktopwall.jpg
Copy wallpaper URL from Azure Blob container
Copy wallpaper URL from Azure Blob container

Step 2 – Download Scripts from GitHub

The next step involves downloading Microsoft-provided scripts from GitHub, which is essential for updating the desktop wallpaper on a macOS device through the Intune admin center.

Step 3 – Update Scripts files

  • downloadWallpaper.sh – This script downloads the wallpaper to the Mac.
  • wallpaper.mobileconfig – This config file Instructs the Mac to change the wallpaper image.

1. Update downloadWallpaper.sh file

  • 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.
Update downloadWallpaper.sh script file to point it to Azure blob storage
Update downloadWallpaper.sh script file to point it to Azure blob storage

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.
Update override-picture-path value to point it to wallpaper downloaded location
Update override-picture-path value to point it to the wallpaper downloaded location

Step 4 – Deploy downloadWallpaper.sh 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 blob 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.

  • Name: Download desktop wallpaper on macOS
  • Description: This shell script will download CloudInfra-desktopwall.jpg wallpaper on targeted macOS devices

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 (No notifications will 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)
macOS Shell Script settings on Intune admin center
macOS Shell Script settings on Intune admin center

Assignments

You can create a dynamic Entra security group to gather your organization’s macOS devices. Click on Add groups to include a group exclusively comprised of macOS devices. Click Next to continue.

Assign the macOS shell script deployment to macOS devices on Intune
Assign the macOS shell script deployment to macOS devices on Intune

Review + add

Review the deployment and click Add to deploy the shell script on targetted macOS devices.

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

Step 5 – Deploy wallpaper.mobileconfig file

The next and final step involves creating a custom device configuration profile in the Intune admin center to apply the desktop wallpaper using the wallpaper.mobileconfig configuration file.

As a previous step, we deployed a shell script to download the wallpaper onto macOS desktops. Now, the wallpaper.mobileconfig will utilize the locally downloaded wallpaper file and set it on the device. Let’s go through the steps:

  • Sign in to the Intune admin center.
  • Devices > Configuration > Create > New Policy.
  • Platform: macOS
  • Profile type: Templates
  • Template name: Custom

Click on Create to begin.

Basics Tab

Provide a name and description of this deployment. Click on Next to proceed.

  • Name: Apply desktop wallpaper on macOS
  • Description: This config file will apply desktop wallpaper on macOS

Configuration settings

Please provide the necessary information regarding the deployment channel and the configuration file for the 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.
Configuration settings to upload wallpaper.mobileconfig file for applying desktop wallpaper on macOS using Intune
Configuration settings to upload wallpaper.mobileconfig file for applying desktop wallpaper on macOS using Intune

Assignments

You can utilize the same Entra security group you used to deploy the shell script. Click on Add groups to include a group that consists of macOS devices. Proceed by clicking Next.

Review + create

Review the deployment and proceed to Create it.

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 process is completed, you can confirm the deployment on one of the target devices by following these steps:

  • Go to Finder App > Go > Go to Folder.
  • Search for /library/desktop path.
  • Double-click on it to open.
Search for /library/desktop path on macOS
Search for /library/desktop path on macOS
  • As shown in the below screenshot, the wallpaper has been successfully downloaded and is now available on the desktop.
Desktop wallpaper downloaded on macOS by Intune macOS shell script
Desktop wallpaper downloaded on macOS by Intune macOS shell script
  • After a few minutes, a new wallpaper will be automatically set on the macOS device as the configuration profile takes effect.
Desktop Wallpaper updated on macOS device using Intune
Desktop Wallpaper updated on macOS device using Intune

FAQs

1. Wallpaper file is not getting downloaded on macOS device

I faced this issue when deploying a shell script on a macOS device, and I couldn’t find my wallpaper. This was due to two reasons. The first reason was that the usebingwallpaper value was 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 when downloading your custom wallpaper to the macOS device.

Wallpaper file is not getting downloaded on macOS device
Wallpaper file is not getting downloaded on macOS device

2. Locate the Log files for Troubleshooting deployment Issues

There are two log files you can check to troubleshoot these deployment-related issues on macOS devices. The first is the 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.
Location for /var/log/fetchdesktopwallpaper.log file
Location for /var/log/fetchdesktopwallpaper.log file
fetchdesktopwallpaper.log file on macOS
fetchdesktopwallpaper.log file on macOS

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.
Search for Intune log files on macOS device
Search for Intune log files on a macOS device
  • You can also open Harddisk Drive Explorer on macOS and browse to /Library/Logs/Microsoft/Intune path to check for the log file.
/Library/Logs/Microsoft/Intune path opened from Hard disk explorer
/Library/Logs/Microsoft/Intune path opened from Hard disk explorer

3. 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, How To Collect Intune Logs From MacOS Device.

Conclusion

In this blog post, we’ve learned how to apply desktop wallpaper to 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.

2 thoughts on “How to Set Desktop Wallpaper on macOS using Intune”

  1. 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.

    Reply

Leave a Comment