Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Getting HA-status from PowerCLI

$
0
0

Hello!

 

We are working on a reportingscript for Our vCenter enviroment, and we would like to get the HA-status on Our VM's.

 

We would like to get a True/False value out in the csv file for each vm.

 

I tried "

HA = (Get-VM$_.ExtensionData.Runtime.dasvmprotection.dasProtected).dasProtected

 

"

But that didn't work out.

 

 

Anyone know how I can fix this? Thanks.

 

Script:

 

 

Get-View-ViewTypeVirtualMachine|%{


PSObject-Property @{


=$_.Name


= (Get-View$_.Summary.Runtime.Host).Name


=[system.String]::Join(",",($_.Storage.PerDatastoreUsage |%{Get-View$_.Datastore} |%{$_.Name}))


= (Get-VM$_.Name |Select-Object-PropertyProvisionedSpaceGB).ProvisionedSpaceGB #($_.Storage.PerDatastoreUsage | Measure-Object -Property Committed -Sum).Sum


= (Get-VM$_.Name |Select-Object-PropertynumCPU).NumCpu


= (Get-VM$_.Name |Select-Object-PropertynumvCPUs).NumvCpus


= (Get-VM$_.ExtensionData.Runtime.dasvmprotection.dasProtected).dasProtected



|Export-Csv"C:\Powershell\VM-report.csv"-NoTypeInformation-UseCulture



Viewing all articles
Browse latest Browse all 176483

Trending Articles



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