The following script updates a set of TargetReleaseVersionInfo registry values to force the system to stay on a certain version of Windows. You can use it with your favorite RMM or utilize Action1 to configure multiple endpoints from the cloud.
################
$win_product = ‘Windows 10′
$win_version = ’22H2’ # update this to the desired version, such as 22H1 or 23H1
Set-ItemProperty -Path ‘HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\’ -Name ‘TargetReleaseVersion’ -Value 1 -Type DWord
Set-ItemProperty -Path ‘HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\’ -Name ‘TargetReleaseVersionInfo’ -Value $win_version
Set-ItemProperty -Path ‘HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\’ -Name ‘ProductVersion’ -Value $win_product
##################
P.S. If you don’t automate patch management and endpoint configuration yet, look at Action1. It is free forever for your first 100 endpoints – with no strings attached!