After you install the April 2021 security update (or later updates) for Microsoft Exchange Server 2019, 2016, or 2013, applications start returning one of the following error messages:
The syntax is not supported by this runspace. This can occur if the runspace is in no-language mode.
Exception occured System.Management.Automation.RemoteException: The syntax is not supported by this runspace. This can occur if the runspace is in no-language mode. at System.Management.Automation.Runspaces.AsyncResult.EndInvoke() at System.Management.Automation.PowerShell.CoreInvokeRemoteHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output,
In this situation, the application doesn't retrieve information through Remote PowerShell from the server that's running Exchange Server. In some cases, the application stops responding.
The Exchange Management Console endpoint on the Exchange-based server was changed from FullLanguage mode to NoLanguage mode. Applications that use the FullLanguage mode features of Remote PowerShell now experience the error that is described in the "Symptoms" section when they process Remote PowerShell calls.
To resolve this problem, the application developer has to update the application to work with the new, more restrictive state of the Exchange Shell.
Additionally, we recommend that you use of either of the following solutions:
Make sure that all calls that use .invoke() are also using .AddCommand() and not .AddScript(). For more information, review the guidance from about_Language_Modes - PowerShell | Microsoft Docs.
Implement an imported session instead of using .invoke(). For more information, see David-Barrett-MS/ExchangePowerShellAutomationSample on GitHub. This webpage provides a sample application that demonstrates how to connect to Exchange Remote PowerShell and run cmdlets programmatically.
For more information about the April 2021 security updates, see the following Exchange Team Blog article: