NullReferenceException occurs when you run TestFederationTrust in Exchange Server 2019 and 2016

Applies to: Exchange Server 2019Exchange Server 2016

Symptoms


The following NullReferenceException is shown when you run the Test-FederationTrust cmdlet in Microsoft Exchange Server 2019 or Exchange Server 2016. This issue occurs when a new certificate for the federation trust is enabled, and the previous certificate has expired.

WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance
of an object.
Object reference not set to an instance of an object.
+ CategoryInfo          : NotSpecified: (:) [Test-FederationTrust], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Management.SystemConfigurationTasks.TestFederationTrust

Cause


This issue occurs because a thumbprint property is still printed if null is assigned to orgPrevPrivCertificate when calling this.GetOrganizationCertificate in this situation.

Resolution


To fix this issue, install one of the following updates:

References


Learn about the terminology that Microsoft uses to describe software updates.