I recently worked on an assignment that involved deploying a custom lock screen wallpaper to Windows devices managed by Microsoft Intune. The task required a method that would provide control over the wallpaper without many dependencies. Below is an overview of my approach, which leverages Win32 apps and PowerShell scripts to apply, update, and remove lock screen wallpapers on Windows devices.

The Challenge: Exploring Intune’s Built-in Solutions

When I started investigating how to implement this, I first looked at Intune’s built-in solution for settings management, specifically the Settings Catalog. This method doesn’t require coding, but it has a few challenges:

  • Image Storage Location: The method relies on an external image storage location (e.g., blob storage) or requires copying the image to the local disk on each device before applying the setting.

  • Using Blob Storage: If you choose to use blob storage, the image file may need frequent updates. Moreover, this means you’d need to collaborate with the Azure team to manage the storage, and the devices would store the blob storage URL in their registry for application purposes.

  • Using Local Storage: If you opt for a local image path using Win32 apps, it can be tricky to control the sequence of actions—i.e., copying the image before applying the lock screen setting—because of dependencies on both the image copy process and the Settings Catalog.

After evaluating these options, I decided to take a different approach that would give me more control with minimal dependencies. I went ahead with using Win32 apps, which allowed me to handle everything directly with scripts, providing more flexibility and ease of management.

Intune Custom Lock Screen – Solutions

This method tested and works fine on windows pro and enterprise editions (windows 10/Windows 11) using Intune or SCCM.

Using Win32 Apps with PowerShell Scripts

The solution I implemented uses a Win32 app package containing a few PowerShell scripts and an image that gets copied to the local device. This method works very well for the following scenarios:

  1. Applying a lock screen wallpaper to new devices

  2. Updating the lock screen wallpaper on both new and existing devices

  3. Uninstalling/removing the lock screen wallpaper when it’s no longer needed

The Win32 app package includes several key components:

Intune Custom Lock Screen

  • LockScreenWallpaper25032025.jpg: The custom image file you want to apply as the lock screen wallpaper.

  • Install-LockscreenWallpaper.ps1: A PowerShell script that creates a folder structure, copies the image file, and logs the process. You can modify the script to customize the folder locations as per your requirements.

  • Uninstall-LockscreenWallpaper.ps1: A PowerShell script that removes the image file and the associated registry settings when you want to uninstall the lock screen wallpaper.

  • Install.bat: A batch file that runs the Install-LockscreenWallpaper.ps1 script. (While I prefer using a batch file, you can run the .ps1 script directly if you prefer.)

  • Uninstall.bat: A batch file that runs the Uninstall-LockscreenWallpaper.ps1 script.

  • Detection.txt: This file contains the detection method using the registry key where the lock screen image file is set.

This method ensures that you have full control over the wallpaper deployment process and makes it easy to apply, update, and remove the lock screen wallpaper.

High-Level Steps Performed by the Script:

Here’s an overview of the key tasks performed by the Install-LockscreenWallpaper.ps1 script:

  1. Log Function Setup: The script defines a log function that records messages with a timestamp and status (success, error, or information).

  2. Script and Log Directory Setup:

    • The script determines its own path and sets up the log file location.

    • It ensures the log directory exists, creating it if necessary, and logs the action.

  3. Registry Key Check and Creation:

    • The script checks if the registry key HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP exists.

    • If not, it creates the registry key and logs the success.

  4. Setting Image Path Variables:

    • The script defines the destination folder for the lock screen image and the specific image file name.

  5. Removing Old Files:

    • It removes old files from the destination folder (excluding .log files) to ensure that only the new image is present.

  6. Creating Folder if Necessary:

    • The script checks if the destination folder exists and creates it if it doesn’t. The action is logged.

  7. Copying the New Lock Screen Image:

    • The script copies the new lock screen image file from the script directory to the destination folder.image

  8. Updating Registry Settings:

    • The script sets the following registry keys:

      • LockScreenImagePath: The path to the image file.

      • LockScreenImageUrl: The URL or path where the image is stored.

      • LockScreenImageStatus: A value of 1 to activate the image.

    • image


  9. Logging:

    • The script logs every action (e.g., creating directories, copying files, setting registry keys) with success or error messages to help with troubleshooting.

Updating the Lock Screen Wallpaper:

When you need to update the content (e.g., change the image file), simply:

  1. Edit the .ps1 script to update the image file name.

  2. Re-package the Win32 app and deploy it using Intune.

  3. If you create a new Win32 app (exclude the group from the old app assignment) or update an existing one, make sure to revise the detection method to point to the new image file name.

Some of the screenshot of the Intune win32 app for your reference:

Intune Custom Lock Screen
Intune Custom Lock Screen
Intune Custom Lock Screen
Intune Custom Lock Screen
Intune Custom Lock Screen
Intune Custom Lock Screen

                           

Testing results

Before the deployment

image

After the deployment

Intune Custom Lock Screen

Intune Custom Lock Screen – Troubleshooting

Check if the wallpaper image is copied to the destination location and also the registry key is set to the correct location where the image is located, otherwise you will see black screen wallpaper.

Conclusion

This method provides a simple yet effective solution for deploying custom lock screen wallpapers on Windows devices managed by Intune. By using Win32 apps and PowerShell scripts, you gain full control over the deployment process, whether you’re applying a new wallpaper, updating an existing one, or removing it altogether.

Before using this in a production environment, download the content from the GitHub repository, make the necessary changes, and thoroughly test it. This will ensure everything works as expected in your specific setup.

Comments (0)