I found this PowerShell script, that does what you are trying to do.
https://smulpuru.wordpress.com/2015/04/01/change-wallpaper-using-windows-api-systemparametersinfo-from-user32-dll/
$setwallpapersource = @"
using System.Runtime.InteropServices;
public class wallpaper
{
public const int SetDesktopWallpaper = 20;
public const int UpdateIniFile = 0x01;
public const int SendWinIniChange = 0x02;
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni);
public static void SetWallpaper ( string path )
{
SystemParametersInfo( SetDesktopWallpaper, 0, path, UpdateIniFile | SendWinIniChange );
}
}
"@
Add-Type -TypeDefinition $setwallpapersource
[wallpaper]::SetWallpaper("\\SERVER1\wallpaper.jpg")
The only thing I've noticed with this script is how fast these locations get updated with the new background.
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\CachedFiles\
For some reason in the CachedFiles, it will still so the previous background instead of the new one and TranscodedWallpaper file doesn't update.
Even running this command requires multiple attempts before the wallpaper show up.
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True