Microsoft Exchange Server SE : des scripts PowerShell défaillants après une mise à jour de sécurité ?


Microsoft Exchange Server SE: Do PowerShell scripts fail after a security update?

À la suite de l’installation d’une mise à jour de sécurité sur Microsoft Exchange Server Subscription Edition (SE), nous avons constaté des dysfonctionnements affectant certaines commandes PowerShell et certains scripts d’administration fournis par Microsoft.
Les anomalies concernent notamment le script RedistributeActiveDatabases.ps1, utilisé pour équilibrer la répartition des bases de données au sein d’un Database Availability Group (DAG), ainsi que la commande Test-MAPIConnectivity, employée pour contrôler la connectivité MAPI.

Le point notable est que ces erreurs se produisent également depuis l’Exchange Management Shell (EMS), l’environnement natif d’administration d’Exchange.
Dans cet article, nous détaillons le contexte technique, et les symptômes observés

1. Environnement concerné

Le serveur concerné dispose de la configuration suivante :

PropriétéValeur
ProduitMicrosoft Exchange Server Subscription Edition (SE)
ÉditionEnterprise
Version15.2
Build installé2562.17
Version interne0.1 (8.0.535.0)
Mise à jour affichéeSecurity Update for Exchange Server Subscription Edition (KB5129955)
Date affichée dans l’historique6 octobre 2026

2. Premier problème : RedistributeActiveDatabases.ps1 échoue

Le script RedistributeActiveDatabases.ps1 est fourni dans le répertoire des scripts Exchange :

C:\Program Files\Microsoft\Exchange Server\V15\scripts\

Il permet notamment de rééquilibrer les bases de données d’un DAG en tenant compte de leur préférence d’activation.

Dans notre environnement, l’exécution suivante provoque une erreur :

.\RedistributeActiveDatabases.ps1 `-DagName DAG `-BalanceDbsByActivationPreference -WhatIf

Le paramètre -WhatIf est utilisé pour simuler les opérations envisagées sans les appliquer.

Pourtant, le script s’interrompt avec le message suivant :

Le nom du DAG et la ligne exacte peuvent varier selon l’environnement et la version du script.

Analyse de l’erreur

Le message révèle une incompatibilité entre le type d’objet attendu par le script et celui qu’il reçoit.Le type attendu est :Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup

Le type reçu est :Deserialized.Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup

Le préfixe Deserialized indique généralement qu’un objet a été sérialisé puis désérialisé, notamment lors d’un échange via une session PowerShell distante.

Un objet désérialisé conserve souvent ses propriétés, mais ne possède pas nécessairement le type .NET d’origine ni les méthodes associées. Le script semble donc manipuler un objet représentant un DAG, mais dont le type n’est pas compatible avec la conversion effectuée à l’endroit où l’erreur survient.

Cette observation constitue un indice important. Elle ne permet toutefois pas, à elle seule, d’établir si le problème provient d’une régression du script, d’un changement dans le contexte d’exécution ou d’une modification introduite par une mise à jour.

3. Deuxième problème : Get-ExchangeServer | Test-MAPIConnectivity

Une autre commande utilisée dans notre environnement présente également un dysfonctionnement :

Get-ExchangeServer | Test-MAPIConnectivity
Cette commande enchaîne deux opérations : la récupération des serveurs Exchange, puis le contrôle de la connectivité MAPI.

Capture d'écran d'une erreur dans PowerShell concernant une opération échouée pour l'objet 'MAPIConnectivity' dans un script sur un serveur Exchange.

4. Pourquoi ces dysfonctionnements sont-ils préoccupants ?

Les scripts et commandes intégrés à Exchange jouent un rôle important dans les opérations quotidiennes d’administration et de supervision.

Leur dysfonctionnement peut compliquer plusieurs tâches :

  • Gestion de la haute disponibilité : difficulté à simuler ou à effectuer la redistribution des bases de données dans un DAG.
  • Supervision : impossibilité d’exécuter certains contrôles MAPI avec les scripts existants.
  • Automatisation : échec de tâches planifiées qui reposent sur les commandes concernées.
  • Maintenance : nécessité d’adapter temporairement les procédures d’exploitation.

5. 6. La mise à jour KB5129955 est-elle responsable ?

La présence de la mise à jour de sécurité KB5129955 dans l’historique Windows constitue un élément important du contexte. Toutefois, la proximité temporelle entre une mise à jour et l’apparition d’une erreur ne prouve pas qu’il existe un lien de causalité.

À ce stade, les symptômes décrits justifient une investigation, mais ne permettent pas d’affirmer que KB5129955 est la cause du dysfonctionnement.

****************************


Microsoft Exchange Server SE: Failed PowerShell scripts after a security update?

As a result of installing a security update on Microsoft Exchange Server Subscription Edition (SE), we have seen issues affecting some PowerShell commands and administrative scripts provided by Microsoft.

The anomalies include the RedistributeActiveDatabases.ps1 script, which is used to balance the distribution of databases within a Database Availability Group (DAG), and the Test-MAPIConnectivity command, which is used to control MAPI connectivity.

The notable point is that these errors also occur from the Exchange Management Shell (EMS), the native Exchange administration environment.

In this article, we detail the technical context, the symptoms observed and the diagnostic avenues to investigate this problem.

1. Affected environment

The affected server has the following configuration:

PropertyValue
ProductMicrosoft Exchange Server Subscription Edition (SE)
EditingEnterprise
Version15.2
Build installé2562.17
Internal version0.1 (8.0.535.0)
Update displayedSecurity Update for Exchange Server Subscription Edition (KB5129955)
Date displayed in the historyOctober 6, 2026

According to Microsoft’s official documentation, build 15.2.2562.17 is the initial RTM release of Exchange Server Subscription Edition, released on July 1, 2025.

2. First Issue: RedistributeActiveDatabases.ps1 Fails

The RedistributeActiveDatabases.ps1 script is provided in the Exchange Scripts directory:

C:\Program Files\Microsoft\Exchange Server\V15\scripts\

In particular, it allows you to rebalance the databases of a DAG by taking into account their activation preference.

In our environment, the following execution causes an error:

.\RedistributeActiveDatabases.ps1 `

-DayName DAY’

-BalanceDbsByActivationPreference -WhatIf

The -WhatIf parameter is used to simulate the intended operations without applying them.

However, the script pauses with the following message:

At C:\Program Files\Microsoft\Exchange Server\V15\scripts\ RedistributeActiveDatabases.ps1:2815 char:3

The name of the DAG and the exact line may vary depending on the environment and the version of the script.

Analysis of the error

The message reveals an incompatibility between the type of object the script expects and the one it receives.

Le type attendu est :Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup

Le type reçu est :Deserialized. Microsoft.Exchange.Data.Directory.SystemConfiguration.DatabaseAvailabilityGroup

The Deserialized prefix typically indicates that an object has been serialized and then deserialized, such as when exchanging through a remote PowerShell session.

A deserialized object often retains its properties, but does not necessarily have the original .NET type or associated methods. The script therefore appears to be manipulating an object that represents a DAG, but whose type is not compatible with the conversion performed at the location where the error occurs.

This observation is an important clue. However, it does not, on its own, establish whether the problem is due to a regression of the script, a change in the execution context, or a change introduced by an update.

3. Second Issue: Get-ExchangeServer | Test-MAPIConnectivity

Another command used in our environment also has a malfunction:

Get-ExchangeServer | Test-MAPIConnectivity
This command does two things: recover the Exchange servers, and then check MAPI connectivity.

Message d'erreur de PowerShell concernant un objet non trouvé lors de l'exécution d'une commande Test-MAPIConnectivity dans Microsoft Exchange.

4. Why are these dysfunctions worrying?

Scripts and commands built into Exchange play an important role in day-to-day administration and monitoring operations.

Their malfunction can complicate several tasks:

  • High availability management: Difficulty simulating or redistributing databases in a DAG.
  • Monitoring: Some  MAPI checks cannot be run with existing scripts.
  • Automation: Failure of scheduled tasks that rely on the affected commands.
  • Maintenance: need to temporarily adapt operating procedures.

5. 6. Is the KB5129955 update responsible?

The presence of the KB5129955 security update in Windows history is an important part of the context. However, the temporal proximity between an update and the occurrence of an error does not prove that there is a causal link.

At this stage, the symptoms described warrant investigation, but do not allow us to affirm that KB5129955 is the cause of the dysfunction.

Votre commentaire