Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

How to export into a CSV VMs that are powered on in a cluster

$
0
0

Hello I have the following code but exports all VM that are powered on and off. Is there anyway to export only the VMs that are powered On ?

 

$clusterName = "Whatever"

Get-Cluster -Name $clusterName | Get-VM | Select Name, @{N="Cluster";E={$clusterName}}, @{N="ESX Host";E={Get-VMHost -VM $_ | Select -ExpandProperty Name}}, @{N="Datastore";E={Get-Datastore -VM $_ | Select -ExpandProperty Name}} |Export-Csv C:\report.csv -NoTypeInformation -UseCulture

 

Thanks,


Viewing all articles
Browse latest Browse all 179681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>