VMware Cloud Community
deepeshsk14
Contributor
Contributor

HA DRS report

Hi ,

 

i need a script that can export a csv of Cluster configuration details from multiple vcenter.

 

reference command:

Get-cluster | select Name,HAEnabled,HAFailoverLevel,DrsEnabled,DrsAutomationLevel | Export-Csv "C:\TDC904.CSV"

0 Kudos
9 Replies
LucD
Leadership
Leadership

Connect to multiple vCenters (make sure that DefaultVIServerMode is set to Multiple with Set-PowerCLIConfiguration), then run your code


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
deepeshsk14
Contributor
Contributor

Hi Lucd, Thank you for suggesting.

However, I still need a powercli script that can export data in a single csv file from multiple VC.

 

You can refer below command:

Get-cluster | select Name, HAEnabled, HAFailoverLevel, DrsEnabled, DrsAutomationLevel | Export-Csv "C:\all.CSV"

0 Kudos
LucD
Leadership
Leadership

If you connect to all the vCenters, that line will export the data from all vCenters to that CSV


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
deepeshsk14
Contributor
Contributor

will the data of all different vcenters be exported into a single CSV??

i need it into a single csv file..plz help

0 Kudos
LucD
Leadership
Leadership

Yes, just try it.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
deepeshsk14
Contributor
Contributor

thanks for replying...

my org. needs a script only..

will below script export multiple vcenter data into single csv? please help.

 

$vcservers = get-content "C:\scritp\vcenters.txt"s
$creds = get-credential

Foreach ($vc in $vcservers) {
Connect-VIServer $vc -Credential $creds -ErrorAction SilentlyContinue -ErrorVariable ConnectError | Out-Null
}

Get-cluster | select Name,HAEnabled,HAFailoverLevel,DrsEnabled,DrsAutomationLevel | Export-Csv "C:\HaDrs.CSV"

0 Kudos
LucD
Leadership
Leadership

Provided you use the same credentials for each vCenter, and you have the DefaultVIServerMode set to Multiple, yes, that should work


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
deepeshsk14
Contributor
Contributor

thank you so much....

 

if i need a test environment where we have multiple vcenter to test our scripts...

where can i do that???

0 Kudos
LucD
Leadership
Leadership

I'm afraid that is something you will have to set up yourself.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos