Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to disable SQL Agent MSX Encryption
Function Set-SQLMSXEncryptionChannelOff
{
$Path = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.SE\SQLServerAgent"
$Name = "MsxEncryptChannelOptions"
$DefaultValue = "2"
$NewValue = "0"
$ComputerName = $Env:COMPUTERNAME
$Item = (Get-ItemProperty $Path -Name $Name).$Name
if($Item -eq $DefaultValue)
{
Write-Output "$ComputerName Property set as default, updating it."
Set-ItemProperty -Path $Path -Name $Name -Value $NewValue
}
if($Item -eq $NewValue)
{
Write-Output "$ComputerName Property already set as updated value."
}
else
{
Write-Output "$ComputerName Property set to other value: $Item skipping."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.