Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 49146

PowerCLI Script to get only Datastore Cluster Summary

$
0
0

Hi,

 

I would like to get the report via email for only Datastore Cluster summary report like Datastores cluster Name| Total Capacity| Used Space| Free% | .

Datastores cluster Name | Total Capacity | Used Space  | Free%|

 

I tried below script but it is providing all Datastores Space report, i need only DS cluster Summary

 

$report = foreach($vc in $global:DefaultVIServers){

 

 

    Get-Datastore -Server $vc |

 

 

    where {($_.FreeSpaceGB/$_.CapacityGB) -le 0.15} |

 

 

    Select @{N='vCenter';E={$vc.Name}},

 

 

        @{N='Datacenter';E={$_.Datacenter.Name}},

 

 

        @{N='DSC';E={Get-DatastoreCluster -Datastore $_ -Server $vc | Select -ExpandProperty Name}},

 

 

        Name,CapacityGB,

 

 

        @{N='FreespaceGB';E={[math]::Round($_.FreespaceGB,2)}},

 

 

        @{N='Freespace%';E={[math]::Round($_.FreespaceGB/$_.CapacityGB*100,1)}},

 

 

        @{N='ProvisionedSpaceGB';E={

 

 

        [math]::Round(($_.ExtensionData.Summary.Capacity - $_.Extensiondata.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2)}},

 

 

        @{N='UnCommittedGB';E={[math]::Round($_.ExtensionData.Summary.Uncommitted/1GB,2)}},

 

 

        @{N='VM';E={$_.ExtensionData.VM.Count}}

 

 

}

$report | Export-Csv report.csv -NoTypeInformation -UseCulture

 

Thanks

Ranjith


Viewing all articles
Browse latest Browse all 49146

Trending Articles



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