reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client" /v fClientDisableUDP /t REG_DWORD /d 1 /f
$regPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client"
$valueName = "fClientDisableUDP"
try {
# Create registry path if it doesn't exist
if (!(Test-Path $regPath)) {
New-Item -Path $regPath -Force | Out-Null
}
# Set the registry value
Set-ItemProperty -Path $regPath -Name $valueName -Value 1 -Type DWORD
Write-Host "SUCCESS: Registry key set"
exit 0
} catch {
Write-Host "ERROR: Failed to set registry key"
exit 1
}