03-31-2023 02:01 AM - edited 07-30-2024 01:52 AM
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.
There is a Jumpcloud command template, you can find it here:
Detailed instructions are here alongside with the command script source code.
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"
}
It will be a similar approach for both operations:
We can use the custom mobile config policy as instructed here.
mv /tmp/your_screen.saver.zip "/Library/Screen Savers/your_screen.saver"
<?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>
Done!
Happy Friday IT folks 🙂
Solved! Go to Solution.
07-30-2024 01:52 AM
03-31-2023 11:00 AM
Much needed and well put together instructions @shawnsong!
04-14-2023 01:00 PM
Thank you very much for your information, do you know how we can change the background for Linux?
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. 😉
04-24-2023 07:01 AM
Did the same for MAC Screen saver its not working
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?
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
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.
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.
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.
08-30-2023 03:54 AM
Windows its working but for mac tried same but not working
07-30-2024 01:52 AM
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.