Forum Discussion
Deploying Desktop wallpaper script in Azure Active Directory-Joined Windows 10 Pro devices
This script should work
$RegKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP"
$DesktopPath = "DesktopImagePath"
$DesktopStatus = "DesktopImageStatus"
$DesktopUrl = "DesktopImageUrl"
$StatusValue = "1"
$url = "https://call4cloud.nl/example.jpg"
Md c:\MDM -force
$DesktopImageValue = "C:\MDM\wallpaper.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
Thanks a lot for your input. I understand this script you are sharing should be used instead of the one I am using initially.
Parameters that should change are the value of the wallpaper where it is stored online.
I see that the main difference is that the download storage in the local PC in being done in less restricted folder, right?
Thanks!
- Jul 28, 2021Hi
Hi approach is a little bit different but his script downloads it in the c:\windows\web. You could change that part in the script itself. But then again, my script is way simpler (in my opinion ๐ ) it just downloads the file and sets the PersonalizationCSP ๐- Daniel-MagMatSep 11, 2021Copper ContributorI am giving a try to this script. I will let you know how it went when I get some results back. Thanks!