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
}