Skip to content

Instantly share code, notes, and snippets.

@AshFlaw
Created March 5, 2019 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshFlaw/55a41ba74de4f44bcf8e142b010f30b3 to your computer and use it in GitHub Desktop.
Save AshFlaw/55a41ba74de4f44bcf8e142b010f30b3 to your computer and use it in GitHub Desktop.
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