Most GPO settings are either enforced/user can't change the setting/ or applied only one time /software install/. My question is - if I set a specific registry key using a GPO and the registry key is changed, will the GPO overwrite the registry key with the one set in GPO? We run a specific software, which sets several registry keys in HKLM\Software. We never had any troubles with computers running Windows7, Vista or etc. The problem is that Windows10 for some reason deletes one of these keys every time when it updates. I am asking specifically about registry settings, applied to computers in Active Directory via GPO. Because if the Computer GPO will not override the settings on reboot after they are deleted by Windows10, I would be forced to deploy startup script instead, which will use REG QUERY to check if the key exists and then if it exists - REG DELETE and REG ADD. And if the key does not exist at all - REG ADD to add the key. I want to protect specific registry settings, which Windows10 continues to delete on every update.
The problem is that Windows10 for some reason deletes one of these keys every time when it updates.
GPO-> Preferences->WindowsSettings->Registry and then Item with action Replace
You're using a Group Policy Preference registry item, which is different from a GPO registry setting. This preference item will NOT prevent local manipulation of the key.
Also - you appear to be concerned about the key being deleted before update. You have selected the REPLACE method; it is doing precisely what you have asked it to do. REPLACE will remove the existing entry and write a new one (even if it is the same). the REPLACE method is not idempotent, it will always result in a change. I believe you are looking for UPDATE which will update the value if its not correct.