Windows Local Group Policy:
controlling Updates + screenwallpaper
Create lgpo.sls in /srv/salt with:
Company Local Group Policy:
lgpo.set:
- computer_policy:
Configure Automatic Updates:
Configure automatic updating: 4 - Auto download and schedule the install
Scheduled install day: 5 - Every Thursday
Scheduled install time: "16:00"
- user_policy:
Do not process the legacy run list: Enabled
Desktop Wallpaper:
Wallpaper Name: C:\salt\wallpaper.jpg
WallpaperStyle: Fill
Run myscript:
cmd.run:
- name: gpupdate.exe /force
Then schedule the below command to run “every 30 mins.”
*/30 * * * * salt '*' state.apply lgpo
This location: C:\Windows\PolicyDefinitions
has the adm files that you can view for trouble-shooting.
Windows 10 Configure Automatic Updates differs from Windows 7, so if you have environment with both Win7 and Win 10 your screwed, you need to create different setting for both some times, for example this update setting will work on Windows 7 but Windows 10 will report error missing value you need to add and I forgot what it is, and if you add it, Windows 7 machines wont work.
Sometimes the response will be invalid, however the policy will work, to verify use one of the below:
salt '*' lgpo.get user # By default shows only configured policies
salt '*' lgpo.get machine
salt '*' lgpo.get machine return_not_configured=True
salt '*' lgpo.get_policy_info 'Maximum password age' machine
salt '*' lgpo.get_policy_info 'Desktop Wallpaper' user