【问题标题】:New-PsSession fails with local accountNew-PsSession 使用本地帐户失败
【发布时间】: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


    【解决方案1】:

    Drat,它是 LocalAccountTokenFilterPolicy 注册表项 (https://docs.microsoft.com/en-us/windows-server/manage/windows-admin-center/support/troubleshooting#using-windows-admin-center-in-a-workgroup)。我在工作组服务器上检查过,而不是在域服务器上。

    【讨论】:

      猜你喜欢
      • 2022-01-23
      • 2021-08-25
      • 1970-01-01
      • 1970-01-01
      • 2020-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多