Created
March 5, 2019 19:33
-
-
Save AshFlaw/55a41ba74de4f44bcf8e142b010f30b3 to your computer and use it in GitHub Desktop.
Function to disable SQL Agent MSX Encryption
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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