Remotely Change Wallpaper Issue

I need to change the wallpaper on a couple remote computers, but i am running into issues. When I run it locally it will work, but I need the 2nd “Set-ItemProperty” cmdlet for it to truly work. If I run it locally and do not have the other “Set-ItemProperty” cmdlets it works if you look at under “personalize”, but the wallpaper actually does not change versus adding the other “Set-ItemProperty” cmdlets which forces it (i guess) to actually change the wallpaper. Remotely, it does not change at all though. I have ran it with a person logged in and out. I added the “restart-computer” thinking maybe forcing a log off will change it, but no luck there either. Some help or guidance I would greatly appreciate.

$comp = “115mf”

Copy-Item -Path “C:\Users\name\Pictures\wallpaper.jpg” -Destination “\$comp\c$\Users\Public\Pictures”

Invoke-Command -ComputerName $comp {

Set-Itemproperty -path “HKCU:Control Panel\Desktop” -name WallPaper -value C:\users\Public\Pictures\wallpaper.jpg
Set-ItemProperty -path “HKCU:Control Panel\Desktop” -Name WallpaperStyle -Value 4;
Set-ItemProperty -path “HKCU:Control Panel\Desktop” -Name TileWallpaper -Value 0;

rundll32.exe user32.dll, UpdatePerUserSystemParameters

Restart-Computer -Force


HKCU is “HKEY_CURRENT_USER”; it applies the changes to whatever account is running the script (assuming that the user profile is loaded; I don’t remember if that happens by default with PS Remoting, off the top of my head.) Are you trying to do this for just one user, or for all users on the computer?

If you want the change to apply to all users, you’d need to use Group Policy, or perhaps a logon script on the remote computers.

There was two options when we run a scan and find computers with so much vulnerabilities we wanted to either going to sort it by group through the script that we were going to add to the logon script or just have the script run right away with the new list of computers. But i was just testing it on a couple remote computers with no luck(yes, all users that would logon to those certain computers). The company I work for is centralizing their network, so we don’t have access to change the gpo, but we do have access to logon script. Thank you for your help