How to Set Desktop Wallpaper on macOS using Intune

Recently I have written blog posts on How to Enroll a Mac device into Intune, Fixed Profile Installation Failed Error during macOS enrollment and How to sync macOS device with Intune manually. Today, we are going to see how to set a desktop wallpaper on a macOS device using Intune.

Desktop wallpaper can be easily managed on a macOS using Microsoft Intune. I have worked with many organizations where desktop wallpaper is centrally managed and updated regularly.

In large organizations, where communication to its employees is critical, a desktop wallpaper can be used to provide Information related to company’s latest acheivements of the last quarter or could provide latest news and updates on company policy information etc.

You could also let users to update their own desktop wallpaper as they like. It all depends upon the organization policies related to this. I would prefer it to be managed so that desktop or laptop devices which belong to the organization look consistent. In addition to that it could provide below benefits:

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

Not only on macOS devices, you can manage desktop wallpaper on a Windows device as well. I have written a blog post which provides steps to manage desktop and lock screen wallpaper on Windows devices using Intune.

Steps to set desktop wallpaper on macOS device using Intune

First thing you will need is a desktop wallpaper in a Jpg, jpeg or png file format stored in a Publicly accessible storage location. If your organization wallpaper contains sensitive information, then you can store it in a secure location but the location of the wallpaper must be accessible from Intune managed devices.

If you already have a location ready to use then you can simple note down the URL of the desktop wallpaper file in a notepad. This URL will be used in the script file later. If you do not have a publicly accessible storage location, then you can create one. I will be creating Azure blob container for storing a desktop wallpaper image.

1. Copy wallpapers to a publicly accessible location

You can create a storage account using Microsoft Azure portal > search for Storage account and then click on Create option. Fill in the required details to create a storage account.

Once you have created an Azure Storage account. Open the storage account > Containers > + Container to create a container. Provide the Name of the container and set Public access level to Blob (anonymous read access for blobs only).

Upload desktop wallpaper at this location.

Azure Storage blob / container with desktop wallpaper for macOS
Azure Storage blob / container with desktop wallpaper for macOS

Click on the wallpaper file in Azure Container and then copy its URL to a notepad. You can test if the URL is working by opening Incognito mode of a browser and paste the URL in Address bar. Please make sure you are able to see the desktop wallpaper to confirm if its publicly accessible.

Copy wallpaper URL from Azure Blob container
Copy wallpaper URL from Azure Blob container

2. Download Scripts from Github

Next step is to download the Microsoft provided scripts from Github which we have to use for updating desktop wallpaper on a macOS device from Intune admin center. You can download scripts from here: Desktop Wallpaper macOS Scripts. There is also information provided on this website Desktop Wallpaper macOS Scripts about files. downloadWallpaper.sh and wallpaper.mobileconfig

You can change the name of wallpaper file in downloadWallpaper.sh and wallpaper.mobileconfig files to match it with the desktop wallpaper file name which is stored in a publicly accessible storage place. Please make sure that the name of the wallpaper file matches otherwise wallpaper will not be set / updated / changed.

3. Update Scripts files

downloadWallpaper.sh contains the wallpaper location and download location on macOS. wallpaper.mobileconfig contains the location to pick the wallpaper and apply it on macOS. We have to update these files now before we can create a deployment from Intune admin center.

Update downloadWallpaper.sh file

  • Update wallpaperurl value and set it to the location of the wallpaper.
  • Update wallpaperfile value to match with the wallpaper file name stored in Azure blob container.
  • Update usebingwallpaper 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

Upate the key value for override-picture-path to point it to the downloaded wallpaper in wallpaper.mobileconfig file. 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 wallpaper downloaded location

4. Deploy downloadWallpaper.sh using Intune admin center

Now we need to create a deployment on Intune admin center to deploy downloadWallpaper.sh shell script on macOS devices. When this shell script will execute on the targeted device, it will download the wallpaper from Azure blob container to desktop. Let’s check the steps:

  • Login on Microsoft 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 for 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

Upload script by clicking on blue folder Icon and select 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 Script frequency as 15 minutes. But once the tested completes 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

I have created a dynamic Azure AD group to group all my organization’s macOS devices. Click on Add groups to add a group which contains only macOS devices. I have added Cloudinfra macOS Devices Azure AD group. Click on Next to proceed.

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 then click on Add button to deploy the shell script on targetted macOS devices.

5. Create a Custom Device Configuration profile

Next and final step is to create a custom device configuration profile from Intune admin center to apply desktop wallpaper using wallpaper.mobileconfig configuration file.

We have already deployed a shell script in previous step to download the wallpaper on macOS desktops. wallpaper.mobileconfig will use the locally downloaded wallpaper file and set it on the device. Let’s check the steps:

  • Login on Microsoft Intune admin center
  • Devices > Configuration profiles
  • Click on + Create Profile
  • Platform: macOS
  • Profile type: Templates
  • Template name: Custom

Click on Create to begin.

Basics Tab

Provide a Name and Description for 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

Configuration settings requires information about Deployment channel and configuration file. Let’s provide this information.

  • 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

I have created a dynamic Azure AD group to group all my organization’s macOS devices. Click on Add groups to add a group which contains only macOS devices. I have added Cloudinfra macOS Devices Azure AD group. Click on Next to proceed.

Review + create

Review the deployment and proceed to create it.

Intune Policy Refresh Cycle

The Device will Sync / Check in to start the script execution process. It may take some time for the process to start. Therefore, if you are testing it on a test device, you can force initiate Intune refresh cycle on macOS device which will speed up the scripts download, execution process. You can also use Powershell to force initiate Intune refresh cycle.

Also, you can restart the device first which also starts the device check-in process. Manual sync is not mandatory on user’s devices as the device check-in process happens automatically. But if you are testing the script on a test device then this can speed up your testing and can save some time.

End user Experience

Let’s check the status of deployment on end user device.

  • 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 you can see that the wallpaper has been downloaded on the Desktop.

Desktop wallpaper downloaded on macOS by Intune macOS shell script
Desktop wallpaper downloaded on macOS by Intune macOS shell script

After few minutes, a new wallpaper was set on the macOS device after the device configuration profile got applied.

Desktop Wallpaper updated on macOS device using Intune
Desktop Wallpaper updated on macOS device using Intune

FAQs

Wallpaper file is not getting downloaded on macOS device

I have experienced this issue where I have deployed shell script on macOS device but I could not find my wallpaper. There were two reasons for this, First one was the usebingwallpaper value was set to true.

In that case, wallpaper from Azure blob container will not be downloaded, Instead bing wallpaper will be downloaded. The file name of bing wallpaper will remain the same. For example: “CloudInfra-desktopwall.jpg”. Therefore, please make sure usebingwallpaper is set to false to download your custom wallpaper on the macOS device.

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

Second reason could be if you are looking at the wrong place for downloaded wallpaper. Wallpaper is downloaded under /library/desktop location and not user profile desktop location.

Where to find log files for Troubleshooting deployment Issues

There are two log files you can check to troubleshoot this deployment related issues on macOS device. First file is fetchdesktopwallpaper.log file and second file is IntuneMDMDaemon xxxxxxx.log file. To locate and open these files, you can check below steps:

To open fetchdesktopwallpaper.log file. Please follow below steps:

  • Go to Finder App > Go > Go to Folder..
  • Type /var/log/fetchdesktopwallpaper.log.
  • Double-click on it to open, this will open 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

To open IntuneMDMDaemon xxxxxxx.log file. Please follow below steps:

  • 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 macOS device

You can also open Harddisk drive explorer on macOS and browse to /Library/Logs/Microsoft/Intune path.

/Library/Logs/Microsoft/Intune path opened from Hard disk explorer
/Library/Logs/Microsoft/Intune path opened from Hard disk explorer

Conclusion

In this blog post, we have seen how to apply a desktop wallpaper on macOS devices using Intune. You can rotate company desktop wallpaper across all macOS devices by simply replacing the wallpaper file in Azure storage container. This container location is configured in downloadWallpaper.sh file.

READ NEXT