windows7 && ubuntu 14.04
- name: Create Registry Key
I want use ansible to change all users's wallpaper.
I found a way here to change the wallpaper by changing registry.
However, I can only change the registry of current user by changing the key "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System" .
But I want to change the registry of every user on this computer.
I only got one administrator account. Other users' credentials are not known.
I can change every users registry.
I can only change current user's registry.
Any comments will be appreciated :)
cc @joshludwig @smadam813
click here for bot help
I found this article
It says "If you want to change registry data for a user whose SID is not appearing under HKEY_USERS, you can either log in as that user and make the change, or you can load the registry hive of that user manually. See How To Load a Registry Hive if you need help. "
Is there any way I can load the registry hive with ansible?
I found this article which explains the basic principle
You could probably take the powershell example in the above and loop through it for each user. That could be an interesting challenge as you might need to exclude the system users and also if you have domain logins, not every machine will have had the user log in first, so there might not be a users folder for all users on all machines.
To me this feels more like a job for a custom powershell script but I guess no reason not to turn it into a module.
Thanks for your advice :) !
If you want to have a go at making a general purpose module then win_regedit.ps1 will contain a lot of the logic you'd need for actually making and checking for registry changes. I think it might be a mistake to try and make win_regedit module do this as well as everything else it does - modules get hard to maintain if they try to do lots of things.