PowerShell Script to fix Exchange Server 2013 Security Update MS13-061

Share this:

I wrote the following PowerShell script to help fixing the issue reported by Microsoft Exchange Team (http://blogs.technet.com/b/exchange/archive/2013/08/14/exchange-2013-security-update-ms13-061-status-update.aspx).

You can always go to the server and perform manual steps however you may take advantage of PowerShell to speed up the process. I used all the instructions provided in the Official KB http://support.microsoft.com/kb/2879739 and the script will list the current values and afterwards apply the changes. The script in action can be seen in the figure below.


The script itself is pretty simple and you can change it easily to accommodate your requirements.


The script is listed here as well, save it with .ps1 extension and you are good to go.

Write-Host “Current Values..”
Get-ItemProperty “hklm:SOFTWAREMicrosoftSearch Foundation for Exchange” -Name “DataDirectory”
Get-ItemProperty “hklm:SYSTEMCurrentControlSetServicesHostControllerService” -Name DisplayName
Get-ItemProperty “hklm:SYSTEMCurrentControlSetServicesHostControllerService” -Name “DependOnService”

Write-Host ” Setting up the correct values based on KB 2879739..”
Set-ItemProperty “hklm:SOFTWAREMicrosoftSearch Foundation for Exchange” -Name “DataDirectory”  -Value “C:Program FilesMicrosoftExchange ServerV15BinSearchCeresHostControllerData”
Set-ItemProperty “hklm:SYSTEMCurrentControlSetServicesHostControllerService” -Name DisplayName -Value “Microsoft Exchange Search Host Controller”
New-ItemProperty “hklm:SYSTEMCurrentControlSetServicesHostControllerService” -Name “DependOnService” -Type MultiString -Value http

Write-Host “Restarting the Exchange Serarch Host Controller…”
Restart-Service “Microsoft Exchange Search Host Controller”

Note: After writing this post (I had to update a couple of servers for one of my customers this morning and that is why I created this post Smile) and publishing it I noticed that fellow Michel de Rooij (publisher of EighTwOne blog) had published a script to do the same thing, as a matter of fact he blogged that on 14th (same day of the issue).

Here is the link for his post:  http://eightwone.com/2013/08/14/fix-for-ms13-061-breaking-exchange-2013/

Written by Anderson Patricio

Anderson Patricio is a Canadian Exchange Server MVP and MCSM (Solutions Master) and he contributes to the Microsoft Community with articles, tutorials, blog posts, forums and book reviews. He is a regular contributor at MSExchange.org, ITPROCentral.com and AndersonPatricio.org (Portuguese).