Symptoms
After you upgrade to Cumulative Update 3 for Microsoft Exchange Server 2019 or Cumulative Update 14 for Exchange Server 2016, you receive the following error message:
Log Name: Application
Source: MSExchange Autodiscover
Date: DateTime
Event ID: 1
Task Category: Web
Level: Error
Keywords: Classic
User: N/A
Computer: ComputerName
Description:
Unhandled Exception "Object reference not set to an instance of an object."
Stack trace: at Microsoft.Exchange.AutoDiscoverV2.FlightSettingRepository.GetHostNameFromVdir(ADObjectId serverSiteId, String protocol)
at Microsoft.Exchange.AutoDiscoverV2.AutoDiscoverV2.ExecuteOnPremEndFlow(AutoDiscoverV2Request request)
at Microsoft.Exchange.AutoDiscoverV2.AutoDiscoverV2.Execute(AutoDiscoverV2Request request, ITenantRepository tenantRepository)
at Microsoft.Exchange.AutoDiscoverV2.AutoDiscoverV2HandlerBase.<>c__DisplayClass11_0.<ProcessRequest>b__0()
at Microsoft.Exchange.Common.IL.ILUtil.DoTryFilterCatch(Action tryDelegate, Func`2 filterDelegate, Action`1 catchDelegate)
Workaround
To work around this issue, you should check the external URL for the following virtual directories:
Get-WebServicesVirtualDirectory -server YourExchangeServerName | fl name, *url*
Get-AutodiscoverVirtualDirectory -server YourExchangeServerName | fl name, *url*
Get-ActiveSyncVirtualDirectory -server YourExchangeServerName | fl name, *url*
If the external URL is blank, assign a value to the external URL that corresponds to the public FQDN.
Example:
Step1: Check the Autodiscover URL by using the following cmdlet.
Get-AutodiscoverVirtualDirectory -server YourExchangeServerName | fl name, *url*
Name : Autodiscover (Default Web Site)
InternalUrl :
ExternalUrl :
If the ExternalUrl is empty, use the step2 to assign a value that corresponds to the public FQDN to the Autodiscover external URL.
Step2: Set the Autodiscover External URL by using the following cmdlet.
Get-AutodiscoverVirtualDirectory -Server YourExchangeServerName |set-AutodiscoverVirtualDirectory -ExternalUrl https://autodiscover.FQDN/Autodiscover/Autodiscover.xml
Note
-
ExternalUrl is only accessible when you add the PSSnapin in a new PowerShell session (not EMS) on Exchange Server 2019, Exchange Server 2016, and Exchange Server 2013.
-
You may receive an error message if you do not add the PSSnapin in the new PowerShell session.
For example, you run the following cmdlet without adding the PSSnapin in the new PowerShell session:
Get-AutodiscoverVirtualDirectory -Server $env:COMPUTERNAME | Set-AutodiscoverVirtualDirectory -ExternalUrl "https://autodiscover.365labs.net/Autodiscover/Autodiscover.xml"
Then, you receive the following error message:
A parameter cannot be found that matches parameter name 'ExternalUrl'.
+ CategoryInfo : InvalidArgument: (:) [Set-AutodiscoverVirtualDirectory], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Set-AutodiscoverVirtualDirectory
+ PSComputerName : ex15.365labs.net
To work around this issue, you should run the following command to make the ExternalUrl accessible:
PS C:\PowerShell> Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
References
Learn about the terminology that Microsoft uses to describe software updates.
More information
Microsoft has realized this problem and will post more information in this article when it becomes available.