Skip to content

Enable locking to current Windows version #199

@canihavethisone

Description

@canihavethisone

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions