Skip to content
The Lazy Administrator
  • Home
  • Disclaimer
  • Contact
  • About Me
  • Search Icon

The Lazy Administrator

Finding ways to do the most work with the least effort possible

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

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

July 30, 2019 Brad Wyatt Comments 4 comments

By default, there is an Intune device configuration property that can set a devices wallpaper (Profile Type: Device Restrictions > Personalization) BUT this is only applicable on devices running Windows 10 Enterprise and Windows 10 Education. Luckily, using PowerShell we can download a image from the web, save it locally, and set it as our users wallpapers.

First we need to create our PowerShell script. In PowerShell ISE I created the following script and saved it to my local machine

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


$DesktopPath = "DesktopImagePath"
$DesktopStatus = "DesktopImageStatus"
$DesktopUrl = "DesktopImageUrl"

$StatusValue = "1"


$url = "https://www.thelazyadministrator.com/wp-content/uploads/2019/07/nicewall.jpg"
$DesktopImageValue = "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, $DesktopImageValue)



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


New-ItemProperty -Path $RegKeyPath -Name $DesktopStatus -Value $StatusValue -PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name $DesktopPath -Value $DesktopImageValue -PropertyType STRING -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name $DesktopUrl -Value $DesktopImageValue -PropertyType STRING -Force | Out-Null

RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters 1, True

Now, the image I want to set as the wallpaper located at this URL: https://www.thelazyadministrator.com/wp-content/uploads/2019/07/nicewall.jpg

For all of this to work properly I need to have it saved on my end users machine, it will not work if you just set the registry key to the URL. So, I am going to save it at the following directory: C:\MDM\. It will check for the presence of this directory first, if it is not there it will just create it for us. After that it will download and save the image as “wallpaper_LazyAdmin.jpg”, set the wallpaper to that image and then update our preferences. This will set the wallpaper without having the user to log off or reboot.

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 wallpaper is the image specified

Brad Wyatt
Brad Wyatt

My name is Bradley Wyatt; I am a 5x Microsoft Most Valuable Professional (MVP) in Microsoft Azure and Microsoft 365. I have given talks at many different conferences, user groups, and companies throughout the United States, ranging from PowerShell to DevOps Security best practices, and I am the 2022 North American Outstanding Contribution to the Microsoft Community winner.


Intune
Azure, Endpoint Management, Intune, MDM, PowerShell

Post navigation

PREVIOUS
Connect and Navigate the Microsoft Graph API with PowerShell
NEXT
Set Corporate Lock Screen Wallpaper with Intune for Non Windows 10 Enterprise or Windows 10 Education Machines

4 thoughts on “Set Corporate Wallpaper with Intune for Non Windows 10 Enterprise or Windows 10 Education Machines”

  1. Callum says:
    March 8, 2023 at 2:03 am

    This script worked brilliantly on Windows 10, but doesn’t seem to work anymore on Windows 11 22H1/H2 – don’t suppose you’ve found a way to get it working again, have you? Thanks!

    Reply
    1. Yann says:
      January 24, 2024 at 1:05 am

      I modifed the script and this one works nice with windows 11 :
      —————————-
      $RegKeyPath = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP”

      $DesktopPath = “DesktopImagePath”
      $DesktopStatus = “DesktopImageStatus”
      $DesktopUrl = “DesktopImageUrl”

      $StatusValue = “1”

      $url = “YOUR_IMAGE_URL.png”
      $DesktopImageValue = “C:\Temp\YOUR_IMAGE_NAME”
      $directory = “C:\Temp\”

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

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

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

      New-ItemProperty -Path $RegKeyPath -Name $DesktopStatus -Value $StatusValue -PropertyType DWORD -Force | Out-Null
      New-ItemProperty -Path $RegKeyPath -Name $DesktopPath -Value $DesktopImageValue -PropertyType STRING -Force | Out-Null
      New-ItemProperty -Path $RegKeyPath -Name $DesktopUrl -Value $DesktopImageValue -PropertyType STRING -Force | Out-Null

      $code = @’
      using System.Runtime.InteropServices;
      namespace Win32{

      public class Wallpaper{
      [DllImport(“user32.dll”, CharSet=CharSet.Auto)]
      static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;

      public static void SetWallpaper(string thePath){
      SystemParametersInfo(20,0,thePath,3);
      }
      }
      }
      ‘@

      add-type $code

      #Apply the Change on the system
      [Win32.Wallpaper]::SetWallpaper($DesktopImageValue)

      —————————————

      Hope it will works for you 🙂

      Regards
      Yann

      Reply
  2. Rej says:
    January 17, 2024 at 8:32 pm

    Hi Brad,

    Do you have any solution for windows 11 wallpaper change.
    Thank you.

    Reply
  3. Niels says:
    March 14, 2024 at 7:09 am

    Works like a charm on Windows 10/11 22H2 devices except that i had to log off and log on to notice the changed wallpaper.

    Reply

Leave a Reply Cancel reply

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

Subscribe

Email


Categories

  • Active Directory (8)
  • AI (3)
  • API (1)
  • AutoPilot (2)
  • Azure (15)
  • Bicep (4)
  • Connectwise (1)
  • Defender for Cloud Apps (1)
  • Delegated Admin (1)
  • DevOps (6)
  • Graph (6)
  • Intune (15)
  • LabTech (1)
  • Microsoft Teams (6)
  • Office 365 (19)
  • Permissions (2)
  • PowerShell (50)
  • Security (1)
  • SharePoint (3)
  • Skype for Business (1)
  • Terraform (1)
  • Uncategorized (2)
  • Yammer (1)

Recent Comments

  • Kristopher Gates on Getting Started with GitHub Copilot in the CLI
  • MD SHARIQUE AKHTAR on Modern Active Directory – An update to PSHTML-AD-Report
  • TommyBoich on How The ConnectWise Manage API Handles Pagination with PowerShell
  • LOTTERY 365 LOGIN on Windows LAPS Management, Configuration and Troubleshooting Using Microsoft Intune
  • SPRUNKI PHASE 6 on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)

1,739,415 People Reached

© 2025   All Rights Reserved.