Managing vSphere with PowerCLI
Connect to a vCenter Server System
Connect-VIServer -Server 'vCentername or IP address' -Protocol http -User 'MyAdministratorUser' -Password 'MyPassword'
In my environment I’m not using any sort of certificates. But I don’t want to be bothered with the warning, so I’ll follow the suggestion and use the Set-PowerCLIConfiguration cmdlet
Set-PowerCLIConfiguration -InvalidCertificateAction ignore
Get all esxi host with all information(Name,ConnectionState,PowerState,NumCpu ,CpuUsageMhz ,CpuTotalMhz ,MemoryUsageGB ,MemoryTotalGB ,Version) using the following
Get-VMHost
View all virtual machines on the target system
get-VM
Get All IP addresses for all VM’s
Get-VM | Select Name, @{N=”IP Address”;E={@($_.guest.IPAddress[0])}}
Using the following guide you will find helpful cmdlets Managing vSphere with VMware PowerCLI
Leave a comment