简体   繁体   中英

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. Is there a Powershell command let that can get a list of Vcenter servers using Powershell or risk api?

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.

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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