How can i remove restrictions to allow user to change background image

Angelo333 11 Reputation points
2022-04-21T14:15:21.743+00:00

Hi,

I've created a Powershell script to set a company background image via Intune and deployed it to all users, we've decided later that we actually want users to change it if they want but I'm unable to find how exactly to do that and now is showing that some of these settings are hidden or managed by your organization.

I would appreciate it if someone knows how to reverse the changes and free the background again.

This is the script.

$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

Microsoft Security Intune Other
{count} votes

1 answer

Sort by: Most helpful
  1. Rahul Jindal [MVP] 10,911 Reputation points MVP
    2022-04-21T21:10:53.853+00:00

    Hi, have you tried removing the assignment of the PS and then deploying a policy for desktop wallpaper as disabled using settings catalog? In theory it will come down as a managed setting and since the value is disabled, user should be able to set the wallpaper themselves.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.