針對 CredSSP 進行疑難排解

適用于:Azure Stack HCI 版本 22H2 和 21H2

某些 Azure Stack HCI 作業使用 Windows 遠端管理 (WinRM),預設不允許認證委派。 若要允許委派,電腦必須暫時啟用認證安全性支援提供者 (CredSSP)。 CredSSP 是安全性支援提供者,可讓用戶端將認證委派給伺服器進行遠端驗證。

啟用 CredSSP 是降級的安全性狀態,而在大部分情況下,應該在工作或作業完成後停用。

某些需要啟用 CredSSP 的工作包括:

  • 建立叢集精靈工作流程
  • Active Directory 查詢或更新
  • SQL Server 查詢或更新
  • 尋找不同網域或未加入網域環境的帳戶或電腦

疑難排解秘訣

如果您遇到 CredSSP 的問題,下列疑難排解秘訣可能會有幫助:

  • 若要在伺服器而不是在電腦上執行 Windows Admin Center 時使用 [建立叢集] 精靈,您在 Windows Admin Center 伺服器上必須是 [閘道系統管理員] 群組的成員。 如需詳細資訊,請參閱使用 Windows Admin Center 的使用者存取選項

  • 當您執行 [建立叢集] 精靈時,如果 Active Directory 的信任未建立或已中斷,CredSSP 可能會回報問題。 這會導致在建立叢集時使用工作群組型的伺服器。 在此情況下,請嘗試以手動方式重新啟動叢集中的每部伺服器。

  • 在伺服器上執行 Windows Admin Center 時,請確定使用者帳戶是閘道系統管理員群組的成員。

  • 建議您在與受控伺服器相同網域成員的電腦上執行 Windows Admin Center。

  • 若要能夠啟用或停用伺服器上的 CredSSP,請確定您屬於該電腦上的 [閘道系統管理員] 群組。 如需詳細資訊,請參閱設定使用者存取控制和權限的前兩節。

  • 在叢集中的伺服器上重新開機 WinRM 服務,可能會提示您重新建立每個叢集伺服器與 Windows Admin Center 之間的 WinRM 連線。

    其中一種做法是前往每部叢集伺服器,然後在 [工具] 功能表的 Windows Admin Center 中,依序選取 [服務]、[WinRM]、[重新啟動],然後在 [重新啟動服務] 提示中選取 [是]。

手動疑難排解

如果您收到下列 WinRM 錯誤訊息,請嘗試使用本節中的手動驗證步驟來解決錯誤。 錯誤訊息範例:

Connecting to remote <sever name> failed with the following error message: The WinRM client cannot process the request. A computer policy does not allow the delegation of the user credentials to the target computer because the computer is not trusted. The identity of the target computer can be verified if you configure the WSMAN service to use a valid certificate.

本節中的手動驗證步驟會要求您設定下列電腦:

  • 執行 Windows Admin Center 的電腦
  • 您收到錯誤訊息的伺服器

若要解決此錯誤,請視需要嘗試下列補救步驟:

補救措施 1:

  1. 重新啟動執行 Windows Admin Center 和伺服器的電腦。

  2. 請嘗試再次執行 [建立叢集] 精靈。

    如需執行精靈的詳細資訊,請參閱使用 Windows Admin Center 建立 Azure Stack HCI 叢集

補救措施 2:

  1. 在執行 Windows Admin Center 的電腦上,以系統管理員身分開啟 Windows PowerShell,然後執行下列命令:

    Disable-WsmanCredSSP -Role Client  
    
    Enable-WsmanCredSSP -Role Client -DelegateComputer <Server FQDN Name>
    
  2. 使用 RDP 功能連線到伺服器,然後執行下列 PowerShell 命令:

    Disable-WsmanCredSSP -Role Server  
    
    Enable-WsmanCredSSP -Role Server  
    
  3. 請嘗試再次執行 [建立叢集] 精靈。

    如需執行精靈的詳細資訊,請參閱使用 Windows Admin Center 建立 Azure Stack HCI 叢集

補救措施 3:

  1. 在執行 Windows Admin Center 的電腦上,執行下列 PowerShell 命令以檢查服務主體名稱 (SPN):

    setspn -Q WSMAN/<Windows Admin Center Computer Name>  
    

    結果應會列出以下輸出:

    WSMAN/<Windows Admin Center Computer Name>

    WSMAN/<Windows Admin Center Computer FQDN Name>

  2. 如果未列出結果,請執行下列 PowerShell 命令來註冊 SPN:

    setspn -S WSMAN/<Windows Admin Center Computer Name> <Windows Admin Center Computer Name>  
    
    setspn -S WSMAN/<Windows Admin Center Computer Name> <Windows Admin Center Computer FQDN Name>  
    
  3. 使用 RDP 功能連線到伺服器,然後執行下列 PowerShell 命令來檢查 SPN:

    setspn -Q WSMAN/<Server Name>  
    

    結果應會列出以下輸出:

    WSMAN/<Server Name>

    WSMAN/<Server FQDN Name>

  4. 如果未列出結果,請執行下列 PowerShell 命令來註冊 SPN:

    setspn -S WSMAN/<Server Name> <Server Name>  
    
    setspn -S WSMAN/<Server FQDN Name> <Server Name>  
    
  5. 請嘗試再次執行 [建立叢集] 精靈。

    如需執行精靈的詳細資訊,請參閱使用 Windows Admin Center 建立 Azure Stack HCI 叢集

補救措施 4:

如果任何先前的補救步驟失敗或未完成,這可能表示 Active Directory 中有記錄衝突。 您可以使用不同的電腦名稱,將記錄重設為 Active Directory 中的新記錄。

若要重設 Active Directory 中的記錄,請使用新的電腦名稱重新安裝 Azure Stack HCI 作業系統。

補救措施 5:

如果您看到提及 NTLM 的錯誤訊息,請嘗試下列動作:

  1. 在執行 Windows Admin Center (具有「用戶端」CredSSP 角色) 的電腦上,執行下列命令以查看已設定的原則:

    Get-ChildItem hklm:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation
    
  2. 如果 AllowFreshCredentialsWithNTLMOnly 遺失,請執行:

    New-Item hklm:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly
    

    然後執行:

    New-ItemProperty hklm:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly -Name 1 -Value "wsman/<Server FQDN Name>" -Force
    

後續步驟

如需 CredSSP 的詳細資訊,請參閱認證安全性支援提供者