Showing results for 
Search instead for 
Did you mean: 

Managing the desktop background and screensaver via JC cmd

Rising Star III
Rising Star III

Hi folks,

It's been a while since my last post, and what a fulfilling fortnight it has been for the quarter end! As usual, our customers brought a lot of great ideas to the table – managing desktop backgrounds and screensavers appears to be critical for many of them.

So, without further ado, let's address these asks on both macOS and Windows!

Please read on.


For Background

There is a Jumpcloud command template, you can find it here:


Detailed instructions are here alongside with the command script source code.


For Screensaver

  • Create a new command on JC admin console -> Windows -> Powershellshawnsong_1-1680242141763.png
    • Paste the lines below to the command body, and change line 14 “the file name” to your screensaver. 
      New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
      # Get all user SIDs from HKEY_USERS
      $sids = Get-ChildItem -Path 'HKU:' | Where-Object { $_.Name -match 'S-\d-\d+-(\d+-){1,14}\d+$' }
      # Iterate through each SID and set the properties for each user
      foreach ($sid in $sids) {
          $userRegPath = "HKU:\$($sid.Name.Replace('HKEY_USERS\', ''))\Control Panel\Desktop"
          Set-ItemProperty -Path $userRegPath -Name ScreenSaveActive -Value 1
          Set-ItemProperty -Path $userRegPath -Name ScreenSaverIsSecure -Value 1
          Set-ItemProperty -Path $userRegPath -Name ScreenSaveTimeOut -Value 120
          Set-ItemProperty -Path $userRegPath -Name SCRNSAVE.EXE -Value "C:\Windows\Temp\filename_of_your_scr"
    • Scroll down a bit, upload the screensaver file: shawnsong_2-1680242183104.png
      • Save and bind to the target device(s) or device group, and give it a run!
      • (Optional) you can set to run this cmd repeatedly against a device group, in this case, every time a new device is added to that group, it will be automatically compiled. shawnsong_3-1680242206540.png



It will be a similar approach for both operations: 

  1. Using a JC cmd to drop the wallpaper image / screensaver files into place. 
  2. Create a custom configuration profile to provide a path to the wallpaper image / screensaver. 
  3. Use a JC custom MDM configuration policy  to deliver and enforce the setting.

For Background

We can use the custom mobile config policy as instructed here

For Screensaver

  • Create a new command on JC admin console -> Mac -> Run as Root:shawnsong_4-1680242283294.png


  • Paste the line below to the command body, and change the file name to your screensaver. 
    mv /tmp/ "/Library/Screen Savers/your_screen.saver"
  • Scroll down a bit, upload the screensaver file: shawnsong_5-1680242346859.png


  • Save and bind to the target device group.
  • Set to run this cmd repeatedly. This will make sure the screensaver file is there for the mobile.config to apply.                                                                         shawnsong_6-1680242374346.png


  • Now go to Policy Management -> add new -> “Mac - MDM Custom Configuration Profile Policy”: shawnsong_7-1680242404880.png
  • Upload the mobile.config as below, and change line 23 & 25 to reflect your screensaver’s file name:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
    <plist version="1.0">
               <string>/Library/Screen Savers/your_screen.saver</string>
       <string>Set Screen Saver</string>
  • Save it and bind to the same device group as the cmd above. 


    Happy Friday IT folks 🙂



JumpCloud Employee
JumpCloud Employee

Much needed and well put together instructions @shawnsong!

Novitiate I

Thank you very much for your information, do you know how we can change the background for Linux?

Hi Jonathan,

Glad you like it! Initially that was my plan to include Linux (Ubuntu desktop) into the post too, but tried all i can google it went no where 😣 and my Linux knowledge is fairly limited.  But i will definitely revisit this, if you find anything possibly has a chance, feel free to post it here, i'm happy to try it out too. 😉

Novitiate I

Did the same for MAC Screen saver its not working 


could you share the screen shot of the cmd you setup for dropping the screenshot file, and if possible, the mobile config you use in the custom mobile config policy too?

Novitiate II

Hi Shawn, thanks for this script. My company recently refreshed their branding and the marketing team asked me to deploy a branded lock screen out to our Windows users. The script worked perfectly.

One thing to note, is that using the script means using the Personalization-CSP reg key. If this reg key is used, the end user will be prevented from changing their lockscreen or wallpaper. More info.

After a few protests from my users I had to roll these changes back!


Hi Paul,


Thanks for sharing your experience here in such an insightful way!

actually, if you wanted to mandate the background "soft-handed", you can tweak the cmd to NOT run on schedule, rather just shoot the cmd 1 time, and leave the space with the users to change the background/wallpaper later. 

Let me know if this is the scenario fits the need. 



Hey Shawn, 

Would you be able to elaborate? I would love to set a default wallpaper on Windows and Mac but still allow users to change them. 

you may just run the cmd once on both devices, then the user is able to make changes afterwards. however only the users with admin privileges will able to do that. 

Novitiate I

Windows its working but for mac tried same but not working

You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.