- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 02:01 AM - edited 07-30-2024 01:52 AM
Deprecated - please use the latest V2 instead!
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.
Windows
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 -> Powershell
- 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:
- 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.
- Paste the lines below to the command body, and change line 14 “the file name” to your screensaver.
MacOS
It will be a similar approach for both operations:
- Using a JC cmd to drop the wallpaper image / screensaver files into place.
- Create a custom configuration profile to provide a path to the wallpaper image / screensaver.
- 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:
- Paste the line below to the command body, and change the file name to your screensaver.
mv /tmp/your_screen.saver.zip "/Library/Screen Savers/your_screen.saver"
- Scroll down a bit, upload the screensaver file:
- 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.
- Now go to Policy Management -> add new -> “Mac - MDM Custom Configuration Profile Policy”:
- 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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>PayloadDisplayName</key> <string>Screensaver</string> <key>PayloadIdentifier</key> <string>com.apple.screensaver.AF6D0BF4-2403-447B-92D8-C046A3AD7FFE</string> <key>PayloadType</key> <string>com.apple.screensaver</string> <key>PayloadUUID</key> <string>836F1320-7FEC-40FC-96C7-53B87F9B41E6</string> <key>PayloadVersion</key> <integer>1</integer> <key>idleTime</key> <integer>10</integer> <key>loginWindowIdleTime</key> <integer>10</integer> <key>loginWindowModulePath</key> <string>/Library/Screen Savers/your_screen.saver</string> <key>moduleName</key> <string>your_screen_saver</string> </dict> </array> <key>PayloadDisplayName</key> <string>Set Screen Saver</string> <key>PayloadIdentifier</key> <string>JC-SG-Shawn.220282CE-7853-4251-BE0E-B6A872FB7308</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>B77AB11A-0B7C-419F-86FB-9DFB05481917</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist>
- Save it and bind to the same device group as the cmd above.
Done!
Happy Friday IT folks 🙂
Solved! Go to Solution.
- Labels:
-
Bash
-
PowerShell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 01:52 AM
Deprecated - please use the latest V2 instead!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 11:00 AM
Much needed and well put together instructions @shawnsong!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 01:00 PM
Thank you very much for your information, do you know how we can change the background for Linux?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 08:51 PM
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. 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 07:01 AM
Did the same for MAC Screen saver its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 07:14 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 02:10 AM
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!
Cheers,
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 02:20 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 07:49 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 06:35 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 03:54 AM
Windows its working but for mac tried same but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 01:52 AM