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

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 = ""
$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:

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

Leave a Reply

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