小编Mic*_*ens的帖子

无法让 CredSSP 身份验证在 PowerShell 中工作

在尝试使用远程处理创建 PowerShell 脚本时,我遇到了我认为的双跳问题。在那篇文章中,Perriman 简要描述了问题以及解决问题的具体步骤(如果您知道命令,那几乎是微不足道的,但对于像我这样不太熟悉的人来说,这些信息非常宝贵!)。

Enable-WSManCredSSP Server在我的 Win7 服务器上运行Enable-WSManCredSSP Client –DelegateComputer <FQDN of the server>时没有发生任何意外,但尝试在我的 Win7 客户端上运行时产生了这个错误:

Enable-WSManCredSSP : The client cannot connect to the destination specified
in the request. Verify that the service on the destination is running and
is accepting requests.
Consult the logs and documentation for the WS-Management service running
on the destination, most commonly IIS or WinRM. If the destination
is the WinRM service, run the following com mand on the …
Run Code Online (Sandbox Code Playgroud)

powershell remoting credssp winrm

11
推荐指数
1
解决办法
7万
查看次数

跨域边界的新 PSSession

我正在尝试启动一个需要能够创建新会话(使用 New-PSSession)的虚拟机。当然,极具吸引力的about_Remote_Troubleshooting是我的常客

调出基本机器(Win 8.1 Enterprise)后:

  • 例如,我公司的主域是mycompany.com.
  • 我们有一个开发域,dev.mycompany.com因此开发人员可以使用沙箱。
  • 我将新的 VM(名为 my-vm)添加到了开发域dev.mycompany.com
  • 我在新 VM 上有一个本地帐户,该帐户位于my-vm\msorens本地计算机的管理员组中。

第一关:

New-PSSession由于跨域问题,尝试运行失败,访问被拒绝。根据上面引用的故障排除页面:

当另一个域中的用户是本地计算机上 Administrators 组的成员时,该用户无法以管理员权限远程连接到本地计算机。

我不相信这是真的(由于我在领域问题方面缺乏经验),但应用该补救措施的配方允许基本New-PSSession工作:

New-ItemProperty `
-Name LocalAccountTokenFilterPolicy `
-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System `
-PropertyType DWord `
-Value 1
Run Code Online (Sandbox Code Playgroud)

(虽然安全性较低,但很好,因为它只是一个沙盒虚拟机。)

第二关:

有了上面的补丁,我可以成功地做到以下任何一项:

PS> New-PSSession
PS> New-PSSession -ComputerName localhost
PS> New-PSSession -ComputerName my-vm
Run Code Online (Sandbox Code Playgroud)

但是,我的实际需要是给出机器的 FQDN:

PS> New-PSSession -ComputerName my-vm.dev.mycompany.com
Run Code Online (Sandbox Code Playgroud)

由于缺少凭据而失败。这让我们想到:

PS> New-PSSession -ComputerName my-vm.dev.mycompany.com -Credential (Get-Credential)
Run Code Online (Sandbox Code Playgroud)

我尝试了我的本地(my-vm)凭据,导致WinRM 无法处理请求;没有可用的登录服务器

我已经尝试过我的公司域凭据(请注意,这是 mycompany.com 不是虚拟机实际位于 …

powershell domain credentials

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

powershell ×2

credentials ×1

credssp ×1

domain ×1

remoting ×1

winrm ×1