Reputation: 2572
I am looking at powershell group policy cmdlets link and I can't seem to figure out what the practical difference is between:
Set-GPPrefRegistryValue link and
Set-GPRegistryValue link
If I want a group policy to modify a registry key how would one differ from the other?
Upvotes: 1
Views: 413
Reputation: 47872
The differences are described clearly on the pages you linked:
Set-GPPrefRegistryValue
Configures a Registry preference item under either Computer Configuration or User Configuration in a GPO.
Set-GPRegistryValue
Configures one or more registry-based policy settings under either Computer Configuration or User Configuration in a GPO.
You can set registry settings in 2 different places: as a policy, or as a preference.
Policies are enforced. These settings are also older.
Preferences get applied but can get be overridden locally. Preferences also have additional options, item level targeting, etc.
You can see the difference by simply browsing around in the group policy editor. Look for both places where the settings exist.
These cmdlets therefore differ by changing settings in the different places in the GPO.
Upvotes: 2