Change Mac Desktop Wallpaper With a Custom Command

Some organizations require that all of the company's managed macOS devices have custom wallpaper set as the desktop background. This article contains two procedures for IT Admins to control a user's desktop wallpaper:

  • You can create a custom command and use an MDM Custom Configuration Profile and a policy to enforce a specific wallpaper file. Do not use this procedure in conjunction with the Mac Wallpaper Modification Policy.
  • Alternatively, you can create a Mac Wallpaper Modification Policy that allows users to change their wallpaper, and then provide the wallpaper file to them.

Prerequisites:

  • The device or device group must be enrolled in an Mobile Device Management (MDM) to use this method.

Creating a Custom Command for Wallpaper

Three steps are required to fully control a macOS user’s wallpaper:

  1. Create a custom command to provide a wallpaper image to your devices.
  2. Create a custom configuration profile to provide a path to the wallpaper image.
  3. Create a policy to deliver and enforce the wallpaper.

To create a custom command for wallpaper for macOS:

  1. Log in to the JumpCloud Admin Portal: https://console.jumpcloud.com/login.
  2. Go to DEVICE MANAGEMENT > Commands.
  3. Click (+), then choose Command to create a new command.
  4. Under Name, enter a name for the command. For example, Desktop Wallpaper.
  5. Under Run As, choose root.
  6. Under Type, click Mac.
  7. Under Command, enter #!/bin/bash.

Note:

JumpCloud doesn't use a script to push the wallpaper picture, but some text must exist in the command body in order to save the command.

  1. Under Event, choose Run Manually.
  2. (Optional) Under Timeout After and Time to Live Settings, adjust the times to your preference.
  3. Click Upload File, then select the wallpaper image.
  4. Under File Destination, enter your desired path. For example, /Users/Shared. The default is the /tmp/ directory, which is periodically cleared, so you should change this.
  5. Select the Devices or Device Groups tab, then bind the command to the device or group where you want to set the wallpaper.
  6. Click save.
  7. Find the newly created command in the commands list and click Run Now to send the image to the device or group of devices. 

Creating a Custom Configuration Profile

Create a custom configuration profile with a text editor or a configuration profile creator. In the .mobileconfig file below, change the path in line 21 to the path that you set in Step 11 above. For example, you can change <string>/change/your/path/1.jpg<string> to your path: <string>/Users/Shared/Logo.jpg<string>.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
    <key>PayloadContent</key>
    <array>
    <dict>
    <key>PayloadDisplayName</key>
    <string>Desktop Picture</string>
    <key>PayloadIdentifier</key>
    <string>com.apple.desktop.83081CED-5210-4EAC-82DA-7ED1092498DB</string>
    <key>PayloadType</key>
    <string>com.apple.desktop</string>
    <key>PayloadUUID</key>
    <string>B20DC43F-A7D3-4A03-A6B8-B6A6610B2A84</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
    <key>locked</key>
    <true/>
    <key>override-picture-path</key>
    <string>/change/your/path/1.jpg</string>
    </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>Change wallpaper</string>
    <key>PayloadIdentifier</key>
    <string>JC-SG-Shawn.9C4196CF-3629-482E-9A32-6A4052C24F36</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>AD3A7EBB-92FC-4584-828C-67C6D589EDA8</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

Creating a Custom Policy to Enforce a Wallpaper Change

You'll create a custom policy to deliver a .mobileconfig file to enforce the wallpaper change.

  1. In the Admin Portal, navigate to DEVICE MANAGEMENT > Policy Management.
  2. Under the All tab, click +.
  3. Select the Mac tab.
  4. On the New Policy panel, select the Mac tab.
  5. Select the MDM Custom Configuration Profile policy, then click configure.
  6. For Policy Name, enter a name for this policy. For example, Desktop Wallpaper.
  7. Under Settings, click upload and select the .mobileconfig file you modified in Creating a Custom Configuration Profile above.
  8. (Optional) Select the Device Groups tab. Select one or more device groups where you’ll apply this policy. For device groups with multiple OS member types, the policy is applied only to the supported OS.
  9. (Optional) Select the Devices tab. Select one or more devices where you’ll apply this policy. 
  10. Click save. This sets the desktop wallpaper on the device or device group.

Creating a Wallpaper Modification Policy

This policy gives users the ability to change the desktop wallpaper on their macOS devices. Configuring and applying this policy lets users use the Apple menu > System Settings > Wallpaper and upload a company wallpaper file that you provide.

To create Mac Desktop Wallpaper Modification policy:

  1. Log in to the JumpCloud Admin Portal: https://console.jumpcloud.com/login.
  2. Go to DEVICE MANAGEMENT > Policy Management.
  3. Under the All tab, click ( + ).
  4. Select the Mac tab.
  5. Locate the Wallpaper Modification policy, then click configure.
  6. Under Policy Name, enter a name for the policy. For example, EMEA Wallpaper Modification.
  7. Under Settings, select Allow Changing Desktop Wallpaper to let users control their wallpaper through Apple menu > System Settings > Wallpaper. If you don’t select this field, users cannot change their wallpaper on their macOS devices.
  8. (Optional) Select the Device Groups tab. Select one or more device groups where you’ll apply this policy. For device groups with multiple OS member types, the policy is applied only to the supported OS.
  9. (Optional) Select the Devices tab. Select one or more devices where you’ll apply this policy.
  10. Click save.
Back to Top

Still Have Questions?

If you cannot find an answer to your question in our FAQ, you can always contact us.

Submit a Case