Set Corporate Lock Screen Wallpaper with Intune for Non Windows 10 Enterprise or Windows 10 Education Machines

Set Corporate Lock Screen Wallpaper with Intune for Non Windows 10 Enterprise or Windows 10 Education Machines

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:

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://www.thelazyadministrator.com/wp-content/uploads/2019/07/nicewall.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://www.thelazyadministrator.com/wp-content/uploads/2019/07/nicewall.jpg"
$LockScreenImageValue = "C:\MDM\wallpaper_LazyAdmin.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.

In the Azure Portal, navigate to Intune > Device Configuration > PowerShell scripts and press “+ Add” to add a new PowerShell configuration script

In the Basics section, give your policy a valid Name and Description and then press Next

In the Script Settings section, specify the PowerShell script file we created and saved up above

In the Scope Tags section, configure any scope tags for the policy. I do not have any scope tags so I will press Next

In the Assignments section, I will assign this policy to my “Intune Devices” group. You can apply this to any group you prefer. Once you have assigned the policy to the correct group(s) press Next

Finally, in the Review + Add section, review your new configuration policy. If it is set up to your enterprises needs, press Add.

On my target machine I can see that the policy applied as my lock screen wallpaper is the image specified

31 thoughts on “Set Corporate Lock Screen Wallpaper with Intune for Non Windows 10 Enterprise or Windows 10 Education Machines

  1. Thank you for share this, “Set Lock Screen Wallpaper”. However, mine still has the words, a long with the magnifying glass to “Take the quiz”. How do I remove that? Any help would be great.
    Thank you in advance.

    1. weird when I set the Lock Screen wallpaper I don’t get the spotlight anymore. Will have to do some testing in my lab

      1. Thanks! I have tried it on my Windows 10 Pro work PC.
        I’ll create a GPO to set those registry keys.

        Thanks a lot!

        1. Brad,
          I’ve created the GPO to copy the file to the computers, create the registry keys and set their values.
          The only thing I missed was that last command “rundll32.exe…”
          That’s the command that activates it?
          I ran it manually on the computers after the GPO ran and there’s only a blue screen, not the image…
          Anything I’m missing?

          1. If you’re doing GPO I wouldn’t do the GPO to run the script but use the GPO to set the reg keys. After reboot it should be configured

  2. The problem is only Windows Spotlight.
    If it isn’t set before you apply this config, you are ok. But Spotlight is turned on by default on Windows 10 Pro…
    Since there’s no way to disable Spotlight on Windows 10 Pro using GPO, I’m back again to square one.

      1. Same thing happened to me. Images are stored in the correct folder but the lock screen is not changing. If I login as administrator on the device then the lock screen is getting applied. So user should have admin rights on the device to make this work ??

          1. I have used this script to apply lock screen for my whole organisation. But it only works for users who have admin rights.

          2. Just wondered if there was a fix for this as I’m expiriencing the same issue except the lock screen will not show for any user. I have admin rights. The reg key isn’t getting set. It worked for desktop wallpaper.

          3. Yes I was working with someone on LinkedIn who had the issue – run this as x86 PowerShell

          4. Thanks for the response. I recreated the script using Power Shell x86 and I made sure ” Run script in 64 bit PowerShell Host” is set to No. Intune states it succeeded but I’m still not seeing it in my registry and lock screen isn’t changing. The picture gets added to the C:\MDM folder.

          5. No it does not get changed. The reg did change for the desktop background but not changing for lock screen.

  3. Thank you for this, one question is the part: “TIP: Because we are modifying the PersonalizationCSP key, users will see that the lock screen image is managed by Group Policy”, how do we allow users to change the lock screen? I assume its a change on the registry key?

    1. Since this is the key GPO modifies you will see that warning saying GPO is managing it. There is another key to set the wallpaper which will allow the user to change it but I have not found one that does the same for the lockscreen. You may be able to deploy it then deploy another policy to delete the key after it gets applied. Not sure if the wallpaper you had set with cache and still work or if it will just be black because its NULL

  4. Can somebody confirm that this works without admin priviledges? I am seeing the local directory and the file in it, but the background doesn’t appear. I believe this is because writing to the register requires administrator priviledges and our users don’t have those.

    1. Martijn, I’m having the same issue. The script works great when running with Admin Privileges, but it looks like Intune is not running the script in Admin Privileges so it doesn’t have the rights to get the Reg Keys. I’m still trying to figure that out.

  5. Thanks Brad
    I deployed this to my Win 11 desktop and it worked fine but I had to configure the script in Intune to – Run this script using the logged on credential AND -Run script in 64 bit PowerShell Host

  6. Brad,

    Hi. Is there a way to create an exe file that would copy the corporate wallpaper and remove the windows img0.jpg and replace it with the corporate wallpaper inside the exe? I’m thinking 7zip might be able to do that.

    Here’s what I currently have in mind in the exe file:

    folder container the corporate wallpaper
    batch with the following commands:

    akeown /f c:\windows\WEB\wallpaper\Windows\img0.jpg
    takeown /f C:\Windows\Web\4K\Wallpaper\Windows\*.*
    icacls c:\windows\WEB\wallpaper\Windows\img0.jpg /Grant Administrators:(F)
    icacls C:\Windows\Web\4K\Wallpaper\Windows\*.* /Grant Administrators:(F)
    del c:\windows\WEB\wallpaper\Windows\img0.jpg
    del /q C:\Windows\Web\4K\Wallpaper\Windows\*.*
    copy “%~dp0img0.jpg” c:\windows\WEB\wallpaper\Windows\img0.jpg
    copy “%~dp04k\*.*” C:\Windows\Web\4K\Wallpaper\Windows

    Is that doable or more practical for oobe machine?

  7. Can this be modified to change the lock screen into a slideshow? It seems Microsoft made it much harder to setup lock screen slideshows via registry.

Leave a Reply to Andy Jones Cancel reply

Your email address will not be published. Required fields are marked *