gpt4 book ai didi

windows - 在Server Core 2019上对本地帐户使用Power Shell Remoting时访问被拒绝

转载 作者:行者123 更新时间:2023-12-02 23:52:56 24 4
gpt4 key购买 nike

我想在Windows Server Core 2019上使用Power Shell远程触发一些命令。

我正在使用以下内容进入远程 session :

$Username   = "x.x.x.x\Administrator"
$PasswordSS = ConvertTo-SecureString 'The-Password' -AsPlainText -Force
$Cred = New-Object System.management.Automation.PSCredential $Username,$PasswordSS
Enter-PSSession -ComputerName 'x.x.x.x' -Credential $cred

然后,连接失败并显示以下消息:

Enter-PSSession : Connecting to remote server x.x.x.x failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. At line:4 char:2 + Enter-PSSession -ComputerName 'x.x.x.x' -Credential $cred + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (x.x.x.x:String) [Enter-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed



远程计算机位于本地网络上,我可以对其进行ping操作。
管理员帐户是远程计算机上的本地帐户。
远程IP在客户端的受信任主机列表上。
在远程计算机上启用了PSRemoting。

我想念什么?帮助将不胜感激。

最佳答案

这应该在评论中。代表人数不足

一种。重置PSSession配置:
https://stackoverflow.com/a/22385798/10994804

b。将-ComputerName 'x.x.x.x添加到受信任的主机。

Get-Item WSMan:\localhost\Client\TrustedHosts

Set-Item WSMan:\localhost\Client\TrustedHosts -Value x.x.x.x -Force

关于windows - 在Server Core 2019上对本地帐户使用Power Shell Remoting时访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54569222/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com