AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 819165
Accepted
Jason
Jason
Asked: 2016-12-07 16:09:58 +0800 CST2016-12-07 16:09:58 +0800 CST 2016-12-07 16:09:58 +0800 CST

如何远程连接到 Hyper-V 服务器以使用不在同一域中的机器通过 powershell 重新启动 VM

  • 772

我尝试使用的机器不是加入域的(不会加入),并且希望能够使用 PowerShell 脚本远程重启 VM(pfSense)。

我在尝试测试与服务器的连接时不断收到此错误。

PS C:\WINDOWS\system32> Get-VM –computername 'LAB1' | Where { $_.State –eq 'Running' }
Get-VM : The operation on computer 'LAB1' failed: The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or 
the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by 
running the following command: winrm help config.

我试过这个:

winrm set winrm/config/client '@{TrustedHosts="DESKTOP-K2GD11M"}'
Enable-PSRemoting -Force

但仍然得到错误。

我也检查get-item wsman:\localhost\Client\TrustedHosts并添加了主机名或计算机名。

windows powershell hyper-v windows-server-2012-r2
  • 1 1 个回答
  • 560 Views

1 个回答

  • Voted
  1. Best Answer
    Enigman
    2016-12-07T20:03:54+08:002016-12-07T20:03:54+08:00

    从您的域计算机尝试以下操作:(这不使用使用 Powershell Remoting)

    $cred = Get-Credential \LAB1\Username
    Get-VM -Computername LAB1 -Credential $cred |  Where { $_.State –eq 'Running' }
    

    其中,用户名是对您的工作组框具有访问权限的帐户,而 LAB1 是工作组框。

    您将看到一个对话框,提示您输入 LAB1\Username 的密码

    现在,您需要做的是让您的客户端机器(域)信任服务器(工作组)。

    你可以使用

    winrm set winrm/config/client '@{TrustedHosts="LAB1"}'
    

    或者

    set-item wsman:\localhost\Client\TrustedHosts -value LAB1 -concatenate
    

    在您的台式机上。

    然后在测试时,确保您已包含可以访问目标服务器的凭据:

    $cred = Get-Credential \LAB1\Username
    Get-VM –Computername 'LAB1' -Credential $cred | Where { $_.State –eq 'Running' }
    
    • 1

相关问题

  • 知道任何适用于 Windows 的快速可编写脚本的 ftp 客户端吗?[关闭]

  • 如果 Windows 服务崩溃,如何自动重新启动它?

  • 无法安排任务(访问被拒绝)

  • 物理机重启时自动重启虚拟机(VMWare)

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve