In my previous article I showed you how you can leverage PowerShell and Intune to set a computers wallpaper even if the OS was not Enterprise or Education. Currently, if you want to set the wallpaper or lock screen wallpaper via Intune Policies, you must be on either Enterprise or Education. In this article I will show you how you can leverage PowerShell and Intune and set your own lock screen wallpaper no matter the version.

In my example I will use Intune to set the lock screen image of my end user machines to the following image:

wallpaper

First, we need to create a PowerShell script that will do the following:

  • Download the wallpaper.
  • Store the wallpaper locally on the target machine.
  • Set the lock screen wallpaper.

In my example, I want to set my wallpaper as the following image: https://i.postimg.cc/MKQSRsKS/aks.jpg, which will be named wallpaper_LazyAdmin.jpg and stored at C:\MDM. If the directory is not present it will create it, and if the proper registry keys are not found it will create them as well.


$RegKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP"

$LockScreenPath = "LockScreenImagePath"
$LockScreenStatus = "LockScreenImageStatus"
$LockScreenUrl = "LockScreenImageUrl"

$StatusValue = "1"

$url = "https://i.postimg.cc/MKQSRsKS/aks.jpg"
$LockScreenImageValue = "C:\MDM\ls_wallpaper.jpg"
$directory = "C:\MDM\"

If ((Test-Path -Path $directory) -eq $false)
{
    New-Item -Path $directory -ItemType directory
}

$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $LockScreenImageValue)

if (!(Test-Path $RegKeyPath))
{
    Write-Host "Creating registry path $($RegKeyPath)."
    New-Item -Path $RegKeyPath -Force | Out-Null
}

New-ItemProperty -Path $RegKeyPath -Name $LockScreenStatus -Value $StatusValue
-PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name $LockScreenPath -Value $LockScreenImageValue
-PropertyType STRING -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name $LockScreenUrl -Value $LockScreenImageValue
-PropertyType STRING -Force | Out-Null

RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters 1, True

TIP: Because we are modifying the PersonalizationCSP key, users will see that the lock screen image is managed by Group Policy.

When you modify the PowerShell script to fit your corporate needs, save it locally as we will need to import it into Intune.

Go to Intune portal > Device Configuration > PowerShell scripts and press “+ Add” to add a new PowerShell configuration script.

And setting will be like:


configuration profile setting


After getting devices synced, signed out/in or reboot, on our target machines we can see that the policy applied as my wallpaper is the image specified.

lock screen wallpaper