I'm trying to make a program that changes the registry key values on remote machines to block/allow users from personalizing their lock-screen images. It seems the key I need to create is at HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization
with a name of NoChangingLockScreen
.
I could easily do this with a .reg file and merge any changes into their registry (I planned on creating a windows service to monitor for changes in the file), although it seems I cannot even modify any keys inside the HKEY_LOCAL_MACHINE
class.
Please note:
- I am a domain admin across our network, and all remote computers have admin rights
- This issue does not just occur when modifying a remote PC's keys, but my own as well
- I've created the RegistryKey object as writable (See below code)
- It seems I cannot even use the OpenSubKey method, as reading the local_machine path just throws an object exception
- I've checked the permissions inside the Registry for that specific class and made sure my account had full control
I have found very little documentation on other people having permissions issues
RegistryKey myKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows", true);