【发布时间】:2021-03-30 05:17:00
【问题描述】:
我通过 RDP 进入工作组计算机,并尝试在域上与远程服务器建立 PowerShell 远程会话。
当我尝试使用其本地管理员帐户之一连接到远程服务器时,我收到以下错误:
new-pssession : [IP] 连接到远程服务器 IP 失败 以下错误消息:访问被拒绝。了解更多信息, 请参阅 about_Remote_Troubleshooting 帮助主题。
当我使用域管理员帐户运行连接时,连接工作正常。
$domainCred = Get-Credential
$localCred = Get-Credential
PS C:\Users\ss_synadmin> New-PSSession -ComputerName IP -Credential $localCred
New-PSSession : [IP] Connecting to remote server IP failed with the following error message :
Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ComputerName <IP> -Credential $localcred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
PS C:\Users\ss_synadmin> New-PSSession -ComputerName <IP> -Credential $domainCred
Id Name ComputerName State ConfigurationName Availability
-- ---- ------------ ----- ----------------- ------------
16 Session16 IP Opened Microsoft.PowerShell Available
由于两个帐户都是管理员,所以有什么好处?
【问题讨论】:
标签: powershell winrm