简体   繁体   English

如何使用 Powershell 或风险 api 在我的环境中获取 Vcenter 服务器的列表

[英]How can I get a list of Vcenter servers in my environment using Powershell or risk api

I'm trying to get a list of Vcenter servers in my environment.我正在尝试获取我环境中的 Vcenter 服务器列表。 Is there a Powershell command let that can get a list of Vcenter servers using Powershell or risk api?是否有 Powershell 命令可以使用 Powershell 或风险 api 获取 Vcenter 服务器列表?

The vCenter server generally serves as the authentication point and source of the API services, so this isn't generally something that's easy to do. vCenter 服务器通常用作 API 服务的身份验证点和来源,因此这通常不是一件容易的事情。

There is one caveat though, and that is when/if Linked Mode is enabled.但是有一个警告,那就是当/如果启用链接模式。 In those cases you could use PowerCLI (a set of PowerShell modules that are easy to download from the PowerShell Gallery) and use the following commands:在这些情况下,您可以使用 PowerCLI(一组易于从 PowerShell 库下载的 PowerShell 模块)并使用以下命令:

Connect-VIServer vcenter-name.fqdn -AllLinked
$global:DefaultVIServers

To be very clear, the above will not provide all the vCenters in your environment, but only the ones that are in some form of linked mode.需要明确的是,上述内容不会提供您环境中的所有vCenter,而只会提供处于某种形式的链接模式的 vCenter。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM