Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Virtualization

Get a List of all ESX Hosts in a Datacenter

Submitted by on April 17, 2017 – 3:18 pm

Another simple one-liner to get a list of hostnames of all ESX servers in the vCenter. This can be useful for a number of things, specifically as input for other PowerCLI scripts.

Set-PowerCLIConfiguration -Scope Session -WebOperationTimeoutSeconds -1 -Confirm:$false;
Import-Module VMware.VimAutomation.Vds;
$VMHost="vcenter01.domain.com";
Connect-VIServer -Server $VMHost -User 'DOMAIN\User' -Password 'Password1';

Get-Datacenter | Get-VMHost | Get-View | Format-Table -Property Name -AutoSize | Out-File -FilePath C:
\esx_hosts.txt

 

Feel free to check thehouses for sale greenwich ct if you are in need of a property.

Print Friendly, PDF & Email

Leave a Reply