System.ArgumentNullException when you use Set-user to assign block legacy auth policy in Exchange Server 2019

Applies to: Exchange Server 2019

Symptoms


In Microsoft Exchange Server 2019, consider the following scenario:
  • You try to set the block legacy authentication policy by using the Set-user cmdlet for a user.
  • Even if the user’s mailbox is on versions earlier than Exchange Server 2019 CU1, then the policy was being assigned earlier. This is not correct, as the block legacy authentication feature is available only for Exchange Server 2019 CU1 or a later version.

Cause


  • The block legacy authentication feature is available only for Exchange Server 2019 CU1 or a later version. The block legacy authentication policy is assigned to a user by using the Set-user cmdlet, regardless of whether the user’s server name is corrupted. There was no check whether the user’s mailbox is on a server version later than Exchange Server 2019 CU1.
  • A fix was introduced for the same to make sure that the user’s AdminDisplayVersion (server version of the Exchange server that has the user’s mailbox) was being checked before assigning the block legacy authentication policy to the user. Now, because of the AdminDisplayVersion of the user’s mailbox being compared to the Exchange Server 2019 CU1 version, there would be a null exception if the AdminDisplayVersion is null (can occur because of the corruption of the server name). This null exception is now handled and admin is informed about the null server version.

Resolution


To fix this issue, install the Cumulative Update 4 for Exchange Server 2019 or a later cumulative update for Exchange Server 2019.
Admin will be informed about the server version value being null and receive the following error message:
1.png

References


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