Pay attention to settings of the script: the parameter "Run this script using the logged-on credentials" need to be set as YES, because if not you are not setting the desktop of the currently logged user. [Image]: https://i.sstatic.net/Wx1d5cZw.png
Also it is more easy to create a configuration profile: create device -> win10 -> Device restrictions profile
There you can change both desktop background and locked screen background: