Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable locking to current Windows version #199

Open
canihavethisone opened this issue Mar 25, 2023 · 0 comments
Open

Enable locking to current Windows version #199

canihavethisone opened this issue Mar 25, 2023 · 0 comments

Comments

@canihavethisone
Copy link

canihavethisone commented Mar 25, 2023

Use Case

System admins may want to prevent automatic upgrading to new versions with a Windows release. There are registry keys to do this.

Describe the Solution You Would Like

An optional method to set the target version to the current version, thereby preventing feature updates.

Describe Alternatives You've Considered

In a private module, I address this with the following, leveraging a custom fact that queries the current release from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion.

  # Prevent Feature updates by locking the current version
  if $lock_current_version {
    registry_value { 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\TargetReleaseVersion':
      ensure => present,
      type   => 'dword',
      data   => '1',
    }
    registry_value { 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\TargetReleaseVersionInfo':
      ensure => present,
      type   => 'string',
      data   => $facts['windows']['display_version'],
    }
  } else {
    registry_value { 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\TargetReleaseVersion': ensure => absent }
  }

Additional Context

nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants