当我尝试使用Enter-PSSession
连接到远程服务器时,我会得到PSRemotingTransportException
。它说用户要么未知或与错误的密码关联。
它与其他用户一起使用,并且可以在其他服务器上与该用户一起使用。用户位于远程服务器的管理员组中。
我缺少什么?
编辑
我遇到的主要问题是。我有三个服务器:remote1
,remote2
和main
,一个域:domain
,以及两个用户:user1
和user2
。
现在,我在main
上与user1
连接。第一个问题是,当我在remote1
上使用Enter-PSSession
时,我通过user2
连接:
ps c: user user1> whoami
域 user1
ps c: user user1> enter-pssession remote1
[远程1]:ps c: users user2 documents> whoami
域 user2
[远程1]:ps c: users user2 documents>
第二个问题是当我在remote2
上使用Enter-PSSession
时,它不起作用:
ps c: user user1> enter-pssession remote2
enter-pssession:连接到远程服务器失败 以下错误消息:访问被拒绝。有关更多信息,请参阅 about_remote_troubleshooting帮助主题。在线:1 char:16 Enter-pssession<<<<<远程2 categoryInfo:invalidargument :(远程2:字符串)[enter-pssession],psremotingtransportexception 完全QualifiedErrid:CreateMoterunSpaceFailed
ps c: users user1>
hmmm,这听起来很奇怪。
一种可能性是默认的PSSESSION配置被弄乱了。要重置它,请使用以下代码:
Get-PSSessionConfiguration -Name Microsoft.PowerShell | Unregister-PSSessionConfiguration;
然后运行:
Enable-PSRemoting -Force;
另外,您确定在指定凭据时使用domainusername
格式(假设您要指定替代凭据)?
我遇到了同一问题。该用户帐户上有密码吗?我给了我的密码,这个问题消失了。
希望会有所帮助。
您的凭据可能会被缓存,我遇到了同样的问题,并在此处使用该工具更新了在Windows中缓存的Passowords:
https://security.stackexchange.com/questions/15574/how-do-i-i-clear-cached-cached-cached-credentials-from-my-windows-profile
我也遇到了完全相同的问题。我在家中的本地机器上有admin
帐户&远程机器工作。但是,由于我在家中升级到Windows 10,因此我切换到@outlook.com
电子邮件以获取早期的Windows更新,但我注意到Admin帐户仍在那里,尽管以某种方式被掩盖了。现在,我使用已设置的pin
登录Windows。
因此,无论出于何种原因,即使我以前在
之前都可以工作Enter-PSSession remote -Credential admin
但是这有效
Enter-PSSession remote -Credential remteComputerNameadmin
所有计算机都在工作组中,管理员帐户在这两台计算机中均具有相同的密码
我今天遇到了同一问题,我的远程用户无法通过powershell使用Enter -pssession -computername
连接如果您在PowerShell管理员窗口中运行命令:
PS C:Windowssystem32> Get-PSSessionConfiguration
出现以下输出
PS C:Windowssystem32> Get-PSSessionConfiguration
Name : microsoft.powershell
PSVersion : 5.1
StartupScript :
RunAsUser :
Permission : NT AUTHORITYINTERACTIVE AccessAllowed,
BUILTINAdministrators AccessAllowed, BUILTINRemote Management Users AccessAllowed
允许远程管理用户访问,我的远程用户没有明确分配给该组。该远程用户被定义为管理员,我认为这已经足够了。一旦我明确地将登录名添加到远程管理用户组,我就可以与PowerShell连接。
不需要别的,但是我确实添加了一个规则将允许的主机限制为一个IP地址。
Set-Item WSMan:localhostClientTrustedHosts -Force -Value my.remote.ip.address
和重新启动WinRM与重新启动服务Winrm
这是我用来允许RDP访问未定义为管理员