In this post we’ll see how we can set the Desktop Background, Lock Screen wallpaper and Screensaver.

There are two methods to set the Lock Screen and Background wallpaper. You can either use the Configuration Policy or PowerShell script. We’ll see both of them.

Assumption: you have already copied the files to Windows folder using previous post.

Existing setup done:

  1. Two Local users created
  2. Azure AD Connect configured
  3. Seamless Single Sign-On (IE) configured
  4. Seamless Single Sign-On (Firefox) configured
  5. Hybrid Azure AD Join configured
  6. Intune enrollment – Domain Joined Windows 10 devices
  7. Azure AD Join
  8. Office 365 Pro Plus Application
  9. Sample SharePoint Team Site
  10. OneDrive Known Folder Migration and SharePoint library sync
  11. Copy necessary files (Win32 App)

Existing setup:

  1. SkyDC: Machine with ADDS, DNS, DHCP role
  2. SkyCON: Machine where we will install Azure AD Connect
  3. SkyCM: Machine with Configuration Manager Current Branch
  4. SkyTEN1: Domain Joined Windows 10 machine
  5. SkyTEN2: Domain Joined Windows 10 machine
  6. SkyTEN3i: Domain Joined Windows 10 machine (Intune Managed)
  7. SkyTEN4i: Domain Joined Windows 10 machine (Intune Managed)
  8. SkyTEN5i: Azure AD Joined Windows 10 (Intune Managed)
  9. SkyTEN6i: Azure AD Joined Windows 10 (Intune Managed)
  10. SkyTEN7i: Azure AD Joined Windows 10 (Cloud User, Intune Managed)
  11. SkyTEN8i: Azure AD Joined Windows 10 (Cloud User, Intune Managed)

Set Lock Screen wallpaper (Method 1)

Login to Azure portal.

Navigate to Intune -> Device configuration -> Profiles. Click +Create profile.

Enter Name. I have entered Win10 Set Lockscreen Wallpaper.

Enter Description. I have not entered anything.

In Platform, select Windows 10 and later.

In Profile type, select Device restrictions.

Click on Settings – Configure.

Navigate to Settings – Configure -> Locked Screen Experience -> and in Locked screen picture URL (Desktop only) enter the wallpaper in format: file:///c:/windows/Sky366LS.png

Click OK.

Click OK.

Click Create.

Navigate to Assignments.

Choose the appropriate option. If you select Selected Groups, you need to select the appropriate group.

I have selected All Devices.

Click Save after you have selected the appropriate option.

Set Desktop Background wallpaper (Method 2)

$wallpaperSourceFile = “${Env:SystemRoot}\Sky366BG.png”

Remove-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name “Wallpaper”

New-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name Wallpaper -Value $wallpaperSourceFile -PropertyType String

rundll32.exe user32.dll, UpdatePerUserSystemParameters, 0, $false

Create a PowerShell Script with above Text.

Navigate to Intune -> Device configuration -> PowerShell scripts. Click on +Add.

In Name, provide name of the script. I have given Set Desktop Background. Click Next.

Click on the folder icon to browse for the script.

Select the SetWallpaper.ps1 script.

In Run this script using the logged on credentials, select Yes.

Click Next.

In Assignments, select the appropriate option. If you want to deploy it to a group, click on +Select groups to include and select the appropriate group.

I have selected All devices.

Click Next.

Click Add.

You can see that the script is added and deployed.

Set Screen Saver

$screensaverSourceFile = “${Env:SystemRoot}\Sky366.scr”

Remove-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name “ScreenSaveActive”

Remove-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name “ScreenSaverIsSecure”

Remove-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name “ScreenSaveTimeOut”

Remove-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name “SCRNSAVE.EXE”

New-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name ScreenSaveActive -Value 1 -PropertyType String

New-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name ScreenSaverIsSecure -Value 0 -PropertyType String

New-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name ScreenSaveTimeOut -Value 60 -PropertyType String

New-ItemProperty -Path “HKCU:\Control Panel\Desktop” -Name SCRNSAVE.EXE -Value $screensaverSourceFile -PropertyType String

Create a PowerShell Script with above Text.

Follow above method to add the PowerShell Script in Intune.

Make sure that you run the script using logged on user’s credentials.

Deploy it to appropriate group

You can see that the script is added and deployed.

In Client machine:

Sync the device

Log off once

Locked screen picture.

Desktop background

Screen Saver


  1. Avaron


    Need some help if possible.
    I followed all the instructions to the letter but cannot get the screensaver part working. Lockscreen and everything else works. Any help?

    • Device n Cloud


      Hi Avaron,
      Did you copy the Screensaver file using the previous post Copy Files using Win32 App ?
      Do you see the registry entry configured as mentioned in the PowerShell script?
      If yes, then can you directly run the PowerShell script in the test machine and see if screensaver get deployed?

      • Avaron


        Win32 App created and saved to Intune. All necessary files were saved to the target machine. That part works,
        Deploying the Lockscreen using the Intune profile works as well.
        Screensaver script doesn’t affect the target machine even though Intune says a successful deployment.
        No registry changes were made.
        If I run the same script manually the registry changes are made, however still no screensaver.

        • Device n Cloud


          Hi Avaron,
          This is strange. I had this script running in atleast 3 tenants and it works without any issues.
          Atleast, manually running the ScreenSaver script should definitely work.
          I’ll try to check in another tenant and let you know.
          Meanwhile, please also tell me the Windows 10 version you are using.

          • Avaron

            Windows 10 Enterprise
            The screensaver, although it carries the .scr extension, seems as if it needs to be “installed” for it to work. I fear my issue may be bigger than just the script or file because no matter what, the screensaver just does not deploy. I’m looking into that issue now and will report back my findings.

          • Device n Cloud

            Hi Avaron,
            The best way to try Screen Saver deployment is to take an existing screensaver file. Rename it with a different name. Use that name in the script and deploy. If it gets deployed, then problem is not with the script.
            Let me know.

  2. Nicolai


    I would prefer not to use Method 2, but with Method 1 it seems to fail on new computers. The Configuration deploys before the App which copies the JPG.

  3. Jim


    Several fundamental flaws with both approaches.

    Method 1 – will only work on Windows 10 enterprise. Does not work on windows 10 professional unless you have education mode enabled.
    Method 2 – requires the logged in user to have admin rights, sorry but what decent sys admin gives users full access rights to the registry to do what they want.

  4. Reply

    Sir awesome guide!
    Quick question, is there a way to do all of this in 1 step?
    Copy the files and then set the registry keys to point to the copied files?

    Potentially use your other guide where you copy the files and within the same .cmd file run the registry update commands?

    Main difference is that this is a powershell and the other one is a cmd script, I mean we can covert everything to powershell and it should work right?

    Testing this today, I have programing so powershell/cmd are not my forte.

  5. Ben


    Hey there, good article. One issue, Intune doesnt accept a URL in the format file:///c:/WINDOWS/System32/Ofgem_lockscreen_background.jpg and complains “Must be a valid url”. Any ideas?

    • Device n Cloud


      Hi Ben,

      Thank you for your comment.

      I have checked and found out that it is broken now. When I created the post, it was working. There is not issue with the file URL. You can test the URL in any browser and it will open the image correctly.

      If you check the corresponding Personalization CSP, it also says that File URL is supported. It just not taking it as a valid input now. You can try creating a custom policy using Personalization CSP and check.


Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.