在 VM 主机/VM 中查找 SCVMM 管理服务器

发布于 2024-11-16 14:26:09 字数 133 浏览 6 评论 0原文

是否可以从 Hyper-v 主机内找到 SCVMM 管理服务器?这可以通过 powershell 实现吗?我正在尝试查找哪台计算机管理我的一台 Hyper-v 主机。我没有通过registry/wmi进行搜索。有什么想法吗?

提前致谢!

Is it possible to locate a SCVMM Management server from within a Hyper-v host? Is this possible via powershell? I am trying to find which machine manages one of my Hyper-v hosts. I've had no luck searching through registry/wmi. Any ideas?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梨涡 2024-11-23 14:26:09

不确定 powershell,但我今天必须这样做。

1) 查找 scvmm 的端口配置。到目前为止,5985 看起来像这样:链接

2) 在您的主机上,运行 netstat -ano |find "5985"

3) 这应该返回一个列表 scvmm管理服务器已连接。

Not sure about powershell, but I just had to do this today.

1) looked up the port config for scvmm. So far, 5985 looks like the one: Link

2) On your host, run netstat -ano |find "5985"

3) That should return a list scvmm management servers connected.

黑色毁心梦 2024-11-23 14:26:09

据我所知,没有。您可以做的是查询所有SCVMM服务器并查看哪些服务器恰好认识来宾。

加载 VMM 模块并连接到您的 VMM。

# VM name, might or might not be hostname
$guestToLook = "myLostVM"
# A list of all of your VMM servers
$VMMServers = @("vmmsrv01", "vmmsrv02", "vmmsrv03")
$VMMServers | % {
    # Connect to VMM server
    Get-VMMServer $_
    # Get a VM from the VMM host by guest name
    $vm = Get-VM -name $myLostVM
    # If VM object is returned, you got the VM from current VMM host.
    if($vm.Name -eq $myLostVM) { "{0} is managed by VMM host: {1}" -f $vm.Name, $_}
}

As far as I know, no. What you could do is to query all of your SCVMM servers and see which happens to know the guest.

Load up the VMM module and connect to your VMM.

# VM name, might or might not be hostname
$guestToLook = "myLostVM"
# A list of all of your VMM servers
$VMMServers = @("vmmsrv01", "vmmsrv02", "vmmsrv03")
$VMMServers | % {
    # Connect to VMM server
    Get-VMMServer $_
    # Get a VM from the VMM host by guest name
    $vm = Get-VM -name $myLostVM
    # If VM object is returned, you got the VM from current VMM host.
    if($vm.Name -eq $myLostVM) { "{0} is managed by VMM host: {1}" -f $vm.Name, $_}
}
一抹微笑 2024-11-23 14:26:09

这是通过 PowerShell 的解决方案。

首先,我们需要主机上 SCVMM 配置值的注册表路径。

  1. $scvmmAgentKeys = 'HKLM:\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager Agent\Setup'

现在我们从注册表路径获取 SCVMM 代理端口。

  1. $wsManTcpPort = (Get-ItemProperty -Path $scvmmAgentKeys -Name WSManTcpPort).WSManTcpPort

最后,收集正在该端口上侦听的地址。

  1. $scvmmAddress = (Get-NetTCPConnection -LocalPort $wsManTcpPort).LocalAddress |获得独特 |其中 { $_ -ne "::" }

请注意,如果其他任何设备在同一端口上建立了连接(撰写本文时的默认端口为 5985),那么 $scvmmAddress 将是一个包含这些设备地址的数组其他已建立的连接,不一定是 SCVMM。

Here's a solution via PowerShell.

First we need the registry path on the host for SCVMM config values.

  1. $scvmmAgentKeys = 'HKLM:\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager Agent\Setup'

Now we grab the SCVMM agent port from the registry path.

  1. $wsManTcpPort = (Get-ItemProperty -Path $scvmmAgentKeys -Name WSManTcpPort).WSManTcpPort

Finally, collect the addresses which are listening on that port.

  1. $scvmmAddress = (Get-NetTCPConnection -LocalPort $wsManTcpPort).LocalAddress | Get-Unique | where { $_ -ne "::" }

Note that if anything else has a connection established on the same port (default port at time of writing is 5985) then $scvmmAddress will be an array including the addresses of those other established connections, which are not necessarily SCVMMs.

染柒℉ 2024-11-23 14:26:09

极好的 。唯一的更正应是

3. $scvmmAddress = (Get-NetTCPConnection -LocalPort $wsManTcpPort).**Remoteaddress** | Get-Unique | where { $_ -ne "::" }

Fantastic . The only correction shall be

3. $scvmmAddress = (Get-NetTCPConnection -LocalPort $wsManTcpPort).**Remoteaddress** | Get-Unique | where { $_ -ne "::" }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文