Hi I am very new using powershell, I am trying to deploy a desktop wallpaper, which I can but, I would like to know if there's a way where the user can change it, because so far it is not possible. Do I need to modify something on the script or perhaps create a new one? thanks in advance!
Edit: I completely forgot to mention that I deployed it via intune scripts, so this run to our users and deploy the wallpaper and we want they still can change it, it is not mandatory for them to have the company's wallpaper.
This is the script I used:
$RegKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP"
$DesktopPath = "DesktopImagePath"
$DesktopStatus = "DesktopImageStatus"
$DesktopUrl = "DesktopImageUrl"
$StatusValue = "1"
$url = "https://example.png"
$DesktopImageValue = "C:\MDM\example.png"
$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