Automation

 View Only
  • 1.  HA DRS report

    Posted May 26, 2022 07:52 AM

    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"



  • 2.  RE: HA DRS report

    Posted May 26, 2022 08:07 AM

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



  • 3.  RE: HA DRS report

    Posted May 26, 2022 01:20 PM

    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"



  • 4.  RE: HA DRS report

    Posted May 26, 2022 01:21 PM

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



  • 5.  RE: HA DRS report

    Posted May 26, 2022 01:34 PM

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

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



  • 6.  RE: HA DRS report

    Posted May 26, 2022 01:41 PM

    Yes, just try it.



  • 7.  RE: HA DRS report

    Posted May 26, 2022 01:44 PM

    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"



  • 8.  RE: HA DRS report

    Posted May 26, 2022 01:58 PM

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



  • 9.  RE: HA DRS report

    Posted May 26, 2022 03:16 PM

    thank you so much....

     

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

    where can i do that???



  • 10.  RE: HA DRS report

    Posted May 26, 2022 03:29 PM

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