如何使用 PowerShell 在 Windows 服务器上启用 Credssp 身份验证?
powershellmicrosoft technologiessoftware & coding更新于 2026/2/12 20:37:17
在为 Windows 服务器启用 Credssp 身份验证之前,我们首先使用以下命令检查 Credssp 状态。
Get-ChildItem WSMan:\localhost\Service\Auth | Where-Object {$_.Name -eq "CredSSP"}
| Select Name, Value
输出
Name Value ---- ----- CredSSP false
要启用 credssp,
PS C:\> Enable-WSManCredSSP -role server -Force
输出
cfg : http://schemas.microsoft.com/wbem/wsman/1/config/service/auth lang : en-US Basic : false Kerberos : true Negotiate : true Certificate : false CredSSP : true CbtHardeningLevel : Relaxed
要在远程计算机上启用 credssp 身份验证,
Invoke-Command -ComputerName TestMahchine1, TestMachine2 -
ScriptBlock {
Enable-WSManCredSSP -Role Server -Force
}

