Showing posts with label esxcli vmware powercli. Show all posts
Showing posts with label esxcli vmware powercli. Show all posts

October 13, 2018

Get Virtual Machines provisioned Disk size for a list of VMs




Below is a script to get VM provisioned Disk size from list of VMs in a .txt file

you will be getting Total provisioned Disk size for each VM in the list and output will be save to a CSV file 


#Get Virtual Machines Disk size for a list
$vmList = Get-Content D:\temp\inputFile.txt
$results= foreach ($vmName in $vmList) {Get-VM $vmName | Select-Object Name,@{n="HardDiskSizeGB"; e={(Get-HardDisk -VM $_ | Measure-Object -Sum CapacityGB).Sum}}}
$results | Export-Csv "D:\temp\file.csv" 



Redirecting to a CSV file
| Export-Csv "D:\temp\file.csv


Invoke lines from a text file to Power CLI
$vmList = Get-Content D:\temp\inputFile.txt
 

June 4, 2017

Usefull Esxcli network ip commands

esxcli network ip interface list
esxcli network ip interface ipv4 get -n vmk<X>
esxcli network ip interface ipv6 get -n vmk<X>
esxcli network ip interface ipv6 address list
You can retrieve information about DNS with the esxcli network ip dns command in the following two namespaces:
esxcli network ip dns search
esxcli network ip dns server
For information corresponding to the Linux netstat command, use the following ESXCLI command.
esxcli network ip connection list