BigFix Action Script Fails to Change User Wallpaper

Hello, everyone!
I hope you’re all doing well.

I created an Action Script to change the default wallpaper.

When testing it locally with the Fixlet Debugger, the script works correctly and changes the wallpaper as expected. However, when I deploy the action through BigFix, the script fails, and the wallpaper does not change.

Script used:

parameter "CurrentUser" = "{name of current user}"

parameter "WallpaperPath" = "C:\Users\{parameter "CurrentUser"}\Company\Divulgação\Colaboradores\Wallpaper\Wallpaper.png"

if {exists file (parameter "WallpaperPath")}
    waithidden powershell.exe -ExecutionPolicy Bypass -NoProfile -Command "Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name Wallpaper -Value '{parameter "WallpaperPath"}'; rundll32.exe user32.dll, UpdatePerUserSystemParameters"
endif

Relevance:

not exists values "WallPaper" whose (it as string as lowercase contains "Company\Divulgação\Colaboradores\Wallpaper\Wallpaper.png") of key "HKEY_CURRENT_USER\Control Panel\Desktop" of registry

My question is: Could this issue be related to the use of the “HKEY_CURRENT_USER” registry key?
Does BigFix have any limitations when modifying this key directly?

I appreciate any help!

You’re on the right track. Actions run as LocalSystem, so you’re running the script against the wrong HKCU. Consider using an Override on your execution: override | BigFix Developer You’ll be able to use RunAs=currentuser and Hidden=true to modify the wait command.

1 Like

Here is a cool way to change it for all users of that system.

1 Like