疑難排解 Exchange 管理命令介面

 

適用版本: Exchange Server 2010 SP2, Exchange Server 2010 SP3

上次修改主題的時間: 2016-11-28

當您使用遠端 Exchange 管理命令介面搭配 Microsoft Exchange Server 2010 時,可能會遇到問題。您可以使用本主題中的資訊,來診斷和解決用戶端與連線問題。

本主題會利用命令介面解決進行 Exchange 2010 內部部署安裝的系統管理員可能會遇到的問題。如果您正在疑難排解您的 Microsoft Office Outlook Web App 組織的遠端命令介面的問題,請參閱 Windows PowerShell:系統管理員常見問題集

用戶端問題

下列各節描述的技術可用來解決您可能會遇到的用戶端問題。

Windows PowerShell 執行原則造成指令碼執行錯誤

當您使用開啟命令介面主題中的指示,嘗試開啟命令介面時,可能會出現下列錯誤訊息。造成錯誤的原因是將 Windows PowerShell 中的指令碼執行原則設定為 RestrictedAllSigned。若要解決此問題,必須將指令碼執行原則設為 RemoteSigned。如需詳細資訊,請參閱安裝 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

Windows PowerShell 執行原則造成 Import-PSSession 錯誤

當您使用將遠端 Exchange 管理命令介面連接至 Exchange Server 主題中的指示,嘗試使用遠端命令介面連線到遠端 Exchange 2010 伺服器時,可能會出現下列錯誤訊息。造成錯誤的原因是將 Windows PowerShell 中的指令碼執行原則設定為 RestrictedAllSigned。若要解決此問題,必須將指令碼執行原則設為 RemoteSigned。如需詳細資訊,請參閱安裝 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

在管線中使用 ForEach 指令程式以及在其指令碼區塊中使用指令程式時發生錯誤

當您將 ForEach 指令程式用於管線中,且出現下列情況時,可能會收到下列錯誤訊息:

  • ForEach 指令程式接受的資料來自管線中較早的指令程式。

  • ForEach 指令程式上的指令碼區塊包含指令程式。

造成此錯誤的原因是 Windows PowerShell 遠端功能不支援同時執行多個管線。若要解決此問題,請將管線中較早的指令程式輸出儲存在變數中,然後透過管線將變數中儲存的資料傳送至 ForEach Cmdlet。此範例會產生並行管線錯誤。

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

產生下列錯誤訊息。

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

若要解決錯誤,請將 Get-Mailbox 指令程式的輸出儲存在變數中,然後透過管線將變數傳送至 ForEach 指令程式,如下列範例所示。

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

安裝的 Windows PowerShell 版本不正確

如果未安裝正確的 Windows PowerShell 版本,就可能會收到下列錯誤訊息。您必須要有 Windows Management Framework 中可用的 Windows PowerShell 2.0,才能連線到遠端 Exchange 2010 伺服器。如需詳細資訊,請參閱安裝 Windows Management Framework

如果已安裝 Windows PowerShell 1.0,就可能會收到下列錯誤訊息。

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

如果已安裝 Windows PowerShell 2.0 發行前版本,就可能會收到下列錯誤訊息。

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

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

連線問題

下列各節描述的技術可用來解決您可能會遇到的連線問題。

使用者名稱或密碼不正確

如果您指定的使用者名稱或密碼不正確,就會收到下列錯誤訊息。確認您使用的使用者名稱與密碼正確無誤。

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

使用者尚未啟用遠端命令介面

如果使用者嘗試連接到遠端 Exchange 2010 伺服器並且遠端命令介面未啟用,您可能會收到下列錯誤訊息。如需如何為使用者啟用遠端命令介面的詳細資訊,請參閱為使用者啟用遠端 Exchange 管理命令介面

[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

提供的伺服器名稱不存在

如果您在遠端命令介面 URL 中指定的伺服器名稱不存在,就會收到下列錯誤訊息。若要解決此問題,請驗證伺服器名稱。如需詳細資訊,請參閱將遠端 Exchange 管理命令介面連接至 Exchange Server

[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 

虛擬目錄名稱不正確

如果在連接到遠端 Exchange 2010 伺服器時指定錯誤的虛擬目錄,您可能會收到下列錯誤訊息。若要解決此問題,請確認虛擬目錄名稱。如需詳細資訊,請參閱將遠端 Exchange 管理命令介面連接至 Exchange Server

[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

Import-PSSession 指令程式執行時出現警告

如果您使用將遠端 Exchange 管理命令介面連接至 Exchange Server 主題中提供的程序連線到遠端 Exchange 2010 伺服器,則將 Exchange 2010 指令程式匯入本機用戶端之後,通常會看到下列警告。

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

如果您使用 HTTPS 通訊協定,則連線到遠端 Exchange 2010 伺服器時,就可能會收到錯誤訊息。發生此錯誤的原因是您的電腦不信任用來簽署安全通訊端層 (SSL) 憑證 (由遠端伺服器使用) 的憑證授權單位 (CA)。若要連線到遠端 Exchange 2010 伺服器,您必須使用 HTTP 通訊協定與 Kerberos 驗證方法。如需詳細資訊,請參閱將遠端 Exchange 管理命令介面連接至 Exchange Server

[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

連線到遠端伺服器時,連線名稱不正確

如果您為 ConnectionName 參數指定的值不正確,則連線到遠端 Exchange 2010 伺服器時,就可能會收到下列錯誤訊息。您必須使用 Microsoft.Exchange 值搭配 ConnectionName 參數。如需詳細資訊,請參閱將遠端 Exchange 管理命令介面連接至 Exchange Server

[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

連線到遠端伺服器時使用的驗證不正確

如果您指定 Kerberos 以外的驗證方法,則連線到遠端 Exchange 2010 伺服器時,可能會收到下列其中一個錯誤訊息。若要連線到遠端 Exchange 2010 伺服器,您必須使用 Kerberos 驗證方法與 HTTP 通訊協定。如需詳細資訊,請參閱將遠端 Exchange 管理命令介面連接至 Exchange Server

[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

[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

[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

[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

[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