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

6 comments

  1. Avaron

    Reply

    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

      Reply

      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

        Reply

        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

          Reply

          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.

Leave a comment

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