Dépannage de l'environnement de ligne de commande Exchange Management Shell

 

S’applique à : Exchange Server 2010 SP2, Exchange Server 2010 SP3

Dernière rubrique modifiée : 2016-11-28

Des problèmes peuvent survenir lorsque vous associez l’environnement de ligne de commande distant Exchange Management Shell à Microsoft Exchange Server 2010. Les informations contenues dans cette rubrique vous permettront de diagnostiquer et de résoudre des problèmes liés au client et à la connexion.

Cette rubrique aborde les problèmes relatifs à l’environnement de ligne de commande que les administrateurs des installations locales d’Exchange 2010 sont susceptibles de rencontrer. Si vous rencontrez des problèmes dans l’environnement de ligne de commande distant pour votre organisation Microsoft Office Outlook Web App, consultez la section Windows PowerShell : FAQ pour les administrateurs.

Problèmes liés au client

Les sections suivantes décrivent les techniques de résolution des problèmes qui sont susceptibles de se produire au niveau du client.

Erreur d’exécution de script due à la stratégie d’exécution de Windows PowerShell

Le message d’erreur suivant peut s’afficher si vous tentez d’ouvrir l’environnement de ligne de commande en suivant les instructions contenues dans la rubrique Ouvrir le Shell. L’erreur est causée en définissant la stratégie d’exécution du script de Windows PowerShell sur Restricted ou sur AllSigned. Pour remédier à ce problème, vous devez définir la stratégie d’exécution du script sur RemoteSigned. Pour plus d’informations, voir Installer Windows Management Framework.

File D:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1 cann
ot be loaded because the execution of scripts is disabled on this system. Pleas
e see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<<  'D:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps
1'; Connect-ExchangeServer -auto
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

The term 'Connect-ExchangeServer' is not recognized as the name of a cmdlet, fu
nction, script file, or operable program. Check the spelling of the name, or if
 a path was included, verify that the path is correct and try again.
At line:1 char:98
+ . 'D:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Co
nnect-ExchangeServer <<<<  -auto
    + CategoryInfo          : ObjectNotFound: (Connect-ExchangeServer:String)
   [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Erreur Import-PSSession due à la stratégie d’exécution de Windows PowerShell

Le message d’erreur suivant peut s’afficher si vous tentez d’utiliser l’environnement de ligne de commande distant pour vous connecter à un serveur Exchange 2010 distant en suivant les instructions contenues dans la rubrique Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange. L’erreur est causée en définissant la stratégie d’exécution du script de Windows PowerShell sur Restricted ou sur AllSigned. Pour remédier à ce problème, vous devez définir la stratégie d’exécution du script sur RemoteSigned. Pour plus d’informations, voir Installer Windows Management Framework.

Import-Module : There were errors in loading the format data file:
Microsoft.PowerShell, , D:\Users\Administrator\AppData\Local\Temp\1\tmp_88ee1dec-ed9c-4b0c-bc3d-68ca394f6d0f_4ilp43pe.x
vh\tmp_88ee1dec-ed9c-4b0c-bc3d-68ca394f6d0f_4ilp43pe.xvh.format.ps1xml : File skipped because of the following validati
on exception: File D:\Users\Administrator\AppData\Local\Temp\1\tmp_88ee1dec-ed9c-4b0c-bc3d-68ca394f6d0f_4ilp43pe.xvh\tm
p_88ee1dec-ed9c-4b0c-bc3d-68ca394f6d0f_4ilp43pe.xvh.format.ps1xml cannot be loaded because the execution of scripts is
disabled on this system. Please see "get-help about_signing" for more details..
At line:3 char:30
+                 Import-Module <<<<  -Name $name -Alias * -Function * -Prefix $prefix -DisableNameChecking:$disableNam
eChecking -PassThru -ArgumentList @($session)
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Erreur lors de l’utilisation de la cmdlet ForEach dans un pipeline et de cmdlets dans son bloc de scripts

Le message d’erreur suivant s’affiche lorsque vous utilisez la cmdlet ForEach dans un pipeline et que les conditions suivantes sont vérifiées :

  • La cmdlet ForEach accepte les données d’une cmdlet à un stade précoce dans le pipeline.

  • Le bloc de scripts sur la cmdlet ForEach contient une cmdlet.

Cette erreur est due au fait que la fonctionnalité d’accès à distance de Windows PowerShell ne prend pas en charge l’exécution simultanée de plusieurs pipelines. Pour remédier au problème, enregistrez la sortie de la cmdlet à un stade précoce du pipeline dans une variable, puis canalisez les données enregistrées dans la variable vers la cmdlet ForEach. Cet exemple engendre une erreur de pipeline simultanée.

Get-Mailbox | ForEach { Set-Mailbox -ProhibitSendReceiveQuota 3GB }

Le message d’erreur suivant est généré.

Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.
    + CategoryInfo          : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [],
   PSInvalidOperationException
    + FullyQualifiedErrorId : RemotePipelineExecutionFailed

Pour corriger l’erreur, enregistrez la sortie de la cmdlet Get-Mailbox dans une variable, puis canalisez la variable vers la cmdlet ForEach, comme indiqué dans cet exemple.

$Mailboxes = Get-Mailbox
$Mailboxes | ForEach { Set-Mailbox -ProhibitSendReceiveQuota 3GB }

Installation d’une version incorrecte de Windows PowerShell

Les messages d’erreur suivants peuvent s’afficher si la version appropriée de Windows PowerShell n’est pas installée dans votre système. Vous devez disposer de Windows PowerShell 2.0, disponible dans Windows Management Framework, pour vous connecter à un serveur Exchange 2010 distant. Pour plus d’informations, voir Installer Windows Management Framework.

Le message d’erreur suivant peut s’afficher si Windows PowerShell 1.0 est installé dans votre système.

The term 'New-PSSession' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and
 try again.
At line:1 char:25
+ $Session = New-PSSession  <<<< -ConfigurationName Microsoft.Exchange -ConnectionUri http://ExchangeSrv01
/PowerShell/ -Authentication Kerberos

Les messages d’erreur suivants peuvent s’afficher si une version préliminaire de Windows PowerShell 2.0 est installée dans votre système.

New-PSSession : Cannot bind parameter 'Authentication'. Cannot convert value "Kerberos" to type "System.Management.Auto
mation.Runspaces.AuthenticationMechanism" due to invalid enumeration values. Specify one of the following enumeration v
alues and try again. The possible enumeration values are "Default, Basic, Negotiate, NegotiateWithImplicitCredential, C
redssp".
At line:1 char:125
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://4367r10-b36/PowerShell/ -Authent
ication <<<<  Kerberos
    + CategoryInfo          : InvalidArgument: (:) [New-PSSession], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.NewPSSessionCommand

Ou

The term 'New-PSSessionOption' is not recognized as a cmdlet, function, operable program, or script file. Verify the te
rm and try again.
At D:\Program Files\Microsoft\Exchange Server\V14\bin\ConnectFunctions.ps1:220 char:27
+     $so = New-PSSessionOption <<<<  -OperationTimeout $sessionOptionsTimeout -IdleTimeout $sessionOptionsTimeout -Ope
nTimeout $sessionOptionsTimeout;
    + CategoryInfo          : ObjectNotFound: (New-PSSessionOption:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

New-PSSession : [4367r10-b36.dvktun-dom.extest.microsoft.com] Processing data from remote server failed with the follow
ing error message: The Windows Remote Shell cannot process the request; the selector value 098316FC-FBE5-4D17-B992-6530
AF1CF7F3 specified in the request was not found.
At D:\Program Files\Microsoft\Exchange Server\V14\bin\ConnectFunctions.ps1:229 char:28
+             $session = new-pssession <<<<  -connectionURI "http://$fqdn/powershell?serializationLevel=Full" -Configur
ationName Microsoft.Exchange -SessionOption $so #-erroraction silentlycontinue
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : RemoteRunspaceOpenFailed

Problèmes liés à la connexion

Les sections suivantes décrivent les techniques de résolution des problèmes qui sont susceptibles de se produire au niveau de la connexion.

Nom d’utilisateur ou mot de passe incorrect

Le message d’erreur suivant peut s’afficher si le nom d’utilisateur ou le mot de passe que vous avez spécifié est incorrect. Vérifiez que le nom d’utilisateur et le mot de passe utilisés sont corrects.

New-PSSession : [ExchServer] Connecting to remote server failed with the following error message : Access is denied.
At line:1 char:19
+ $Session = New-PSSession <<<<  -ConfigurationName Microsoft.Exchange -ConnectionUri https://ExchServer/powershell/ -Credential
$c -SessionOption $SkipCertificate
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : RemoteRunspaceOpenFailed

L’utilisateur n’est pas activé pour l’environnement de ligne de commande distant

Le message d’erreur suivant peut s’afficher si un utilisateur tente de se connecter à un serveur Exchange 2010 distant alors que l’environnement distant n’est pas activé. Pour plus d’informations sur la procédure d’activation d’utilisateurs pour l’environnement de ligne de commande distant, consultez la rubrique Activer l’environnement de ligne de commande Exchange Management Shell distant pour un utilisateur.

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. It cannot determine the content type of the HTTP response from the destination computer. The content type is a
bsent or invalid. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Le nom de serveur saisi n’existe pas

Le message d’erreur suivant peut s’afficher si le nom de serveur que vous avez spécifié dans l’URL de l’environnement distant n’existe pas. Pour résoudre ce problème, vérifiez le nom du serveur. Pour plus d’informations, voir Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange.

[exchserver01] Connecting to remote server failed with the following error message : WinRM cannot process the request.
The following error occured while using Kerberos authentication: The network path was not found.
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does not exist.
  -The client and remote computers are in different domains and there is no trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or us
e HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command: winrm help config. For more information,
 see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed 

Nom de répertoire virtuel incorrect

Vous pouvez recevoir le message d’erreur suivant si vous indiquez un répertoire virtuel incorrect lors de la connexion à un serveur Exchange 2010 distant. Pour résoudre ce problème, vérifiez le nom du répertoire virtuel. Pour plus d’informations, voir Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange.

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client received an HTTP st
atus code of 403 from the remote WS-Management service. For more information, see the about_Remote_Troubleshooting Help
 topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Avertissement lors de l’exécution de la cmdlet Import-PSSession

Lorsque vous vous connectez à un serveur Exchange 2010 distant via la procédure indiquée dans la rubrique Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange, il n’est pas rare de voir apparaître l’avertissement suivant après l’importation des cmdlets Exchange 2010 dans votre client local.

WARNING: Some imported command names include unapproved verbs which might make them less discoverable.  Use the Verbose
 parameter for more detail or type Get-Verb to see the list of approved verbs.

HTTPS utilisé lors de la connexion à un serveur distant

Un message d’erreur peut s’afficher lors de la connexion à un serveur Exchange 2010 distant si vous utilisez le protocole HTTPS. Cette erreur est due au fait que votre ordinateur n’approuve pas l’autorité de certification (CA) servant à approuver le certificat SSL (Secure Sockets Layer) utilisé par le serveur distant. Pour vous connecter à un serveur Exchange 2010 distant, vous devez utiliser le protocole HTTP et la méthode d’authentification Kerberos. Pour plus d’informations, voir Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange.

[ExchServer] Connecting to remote server failed with the following error message : The server certificate on the destin
ation computer (ExchServer:443) has the following errors:
The SSL certificate is signed by an unknown certificate authority. For more information, see the about_Remote_Troublesh
ooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Nom de connexion incorrect lors de la connexion à un serveur distant

Le message d’erreur suivant peut s’afficher si vous saisissez une valeur incorrecte pour le paramètre ConnectionName lors de la connexion à un serveur Exchange 2010 distant. Vous devez utiliser la valeur Microsoft.Exchange avec le paramètre ConnectionName. Pour plus d’informations, voir Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange.

[ExchServer] Connecting to remote server failed with the following error message : The WS-Management service cannot pro
cess the request. The resource URI (https://schemas.microsoft.com/powershell/MS.Exch) was not found in the WS-Management
 catalog. The catalog contains the metadata that describes resources, or logical endpoints. For more information, see t
he about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Authentification incorrecte utilisée lors de la connexion à un serveur distant

Les messages d’erreur suivants peuvent s’afficher lors de la connexion à un serveur Exchange 2010 distant si vous spécifiez une méthode d’authentification autre que Kerberos. Pour vous connecter à un serveur Exchange 2010 distant, vous devez utiliser la méthode d’authentification Kerberos et le protocole HTTP. Pour plus d’informations, voir Connecter l'environnement de ligne de commande Exchange Management Shell distant à un serveur Exchange.

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. CredSSP authentication is currently disabled in the client configuration. Change the client configuration and
try the request again. CredSSP authentication must also be enabled in the server configuration. Also, Group Policy must
 be edited to allow credential delegation to the target computer. Use gpedit.msc and look at the following policy: Comp
uter Configuration -> Administrative Templates -> System -> Credentials Delegation -> Allow Delegating Fresh Credential
s.  Verify that it is enabled and configured with an SPN appropriate for the target computer. For example, for a target
 computer name "myserver.domain.com", the SPN can be one of the following: WSMAN/myserver.domain.com or WSMAN/*.domain.
com For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Ou

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. Default credentials can be used only with Kerberos authentication or Negotiate authentication under HTTPS if t
he Allow implicit credentials for Negotiate is specified. Explicit credentials must be provided if any other authentica
tion scheme is specified. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Ou

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain,
then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. U
se winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You ca
n get more information about that by running the following command: winrm help config. For more information, see the ab
out_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Ou

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. Unencrypted traffic is currently disabled in the client configuration. Change the client configuration and try
 the request again. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed

Ou

[ExchServer] Connecting to remote server failed with the following error message : The WinRM client cannot process the
request. Unencrypted traffic is currently disabled in the client configuration. Change the client configuration and try
 the request again. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
   eption
    + FullyQualifiedErrorId : PSSessionOpenFailed