Cumulative Updates are great when installing a fresh Exchange server. We are able to install the update straight way and we are ready to go with the latest version. Unfortunately if you start off your installation with Exchange 2016 CU7 you might easily run into an annoying problem.
Exchange 2016 CU7 was released last September. The problem is a bit sneaky because it mostly concerns new installations. Indeed I didn't see this myself immediately, not until I had to do a fresh install.
Basically if you try to install the Exchange 2016 anti-spam agents using the script shipped with CU 7 you could run into an error that causes the installation to fail. Here I am referring to the Content Filter, Recipient Filter, Sender Filter, Sender Id Filter and Sender Reputation Filter.
Normally if you don't have the Edge server role, you install these on the Mailbox server as follows:
- Open the Exchange Management Shell
- Change directory to
<Exchange dir.>\Scripts
- Run>
.\Install-AntiSpamAgents.ps1
Doing this with CU 7 can end-up in failure:
Here is a little text dump of the first part of the error. This should help more people finding this article and the solution presented here.
[PS] E:\ex16\Scripts>.\install-AntispamAgents.ps1
A parameter cannot be found that matches parameter name 'EscalationTeam'.
+ CategoryInfo : InvalidArgument: (:) [Install-TransportAgent],
ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Install-TransportAgent
+ PSComputerName : exchsrv2.adminstop2.com
> : The term '>' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At E:\ex16\Scripts\install-AntispamAgents.ps1:50 char:165
+ ... ransportService $transportService -EscalationTeam "AntiSpam"; > $null
+ ~
+ CategoryInfo : ObjectNotFound: (>:String) [], CommandNotFound
Exception
+ FullyQualifiedErrorId : CommandNotFoundException
Transport agent "Content Filter Agent" isn't found.
Parameter name: Identity
+ CategoryInfo : InvalidArgument: (:) [Enable-TransportAgent],
ArgumentException
+ FullyQualifiedErrorId : [Server=EXCHSRV2,RequestId=50991627-838d-4fde-
a52d-0bd6c2c389ef,TimeStamp=11/1/2017 9:40:52 AM] [FailureCategory=Cmdlet-Ar
gumentException] 2C3FC7CF,Microsoft.Exchange.Management.AgentTasks.EnableTra
nsportAgent
+ PSComputerName : exchsrv2.adminstop2.com
Solution
This problem is easy to solve especially if you have multiple Exchange installations at hand. Just grab a copy of the install script (Install-AntiSpamAgents.ps1) from an earlier Exchange 2016 update, transfer it to your CU7 installation and use that.
I did that and it worked immediately. I also did take the time to compare the scripts to see exactly what the problem was. Basically this is the culprit:
install-TransportAgent -Name:$name -TransportAgentFactory:$factory -AssemblyPath:$agentAssembly -TransportService $transportService -EscalationTeam "AntiSpam"; $null
The only difference in the CU7 script is this extra bit:
-EscalationTeam "AntiSpam";
Without this bit the script would look exactly like the well behaving scripts we had before.
Final Tips
When installing a fresh Exchange server it is always good to start with the latest Cumulative Update. However sometimes we have to deal with these unexpected problems. Hopefully this will be fixed with the next Cumulative Update that is scheduled for next December. In any case I would recommend keeping a copy of the old script handy just in case.
References
Released: September 2017 Quarterly Exchange Updates
Cumulative Update 7 for Exchange Server 2016 (KB4018115)