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

标签 windows powershell server core remoting

我想在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/

相关文章:

azure - 使用 Azure PowerShell 进行数据库迁移

c++ - 客户端服务器 C++ 序列化

Java "TRAP"断言错误

azure - 使用托管标识创建 AKS 集群并通过 az cli 脚本错误与 acr 关联

c# - 邮件在创建后过早启用 AD 帐户

ruby-on-rails - 命令轨服务器

windows - Teamviewer 远程计算机显示黑色而不是登录屏幕

windows - 如何找出唤醒我的电脑的所有 Windows 计划任务?

windows - 在 windows xp 上检索详细的 usb midi 设备信息

c++ - 使用 C 的 Windows 注销捕获