Automation

 View Only
  • 1.  RVTOOLS Automation

    Posted May 10, 2017 08:09 PM

    Hi All,

    I need Powercli script to generate Rvtools report of multiple VCentre and automatically mail us as a single zip file. Please help me as we have 7 Vcentres and we are supporting multiple clients

    Thanks a lot for you help in advance.

    Thanks,

    Karthikeyan Raman



  • 2.  RE: RVTOOLS Automation
    Best Answer

    Posted May 11, 2017 04:38 AM


  • 3.  RE: RVTOOLS Automation

    Posted May 12, 2017 09:56 PM

    Hi LucD,

    I have mutiple VC with different username and password. The passthrough will not work. Please help me to work rvtools script across all the VCentre.

    I want to use the accounts saved by New-VICredentialStoreItem -Host "vCenter1" -User "domain\useracnt" -Password "password"

    Thanks,

    Karthikeyan Raman



  • 4.  RE: RVTOOLS Automation

    Posted May 14, 2017 11:17 AM

    Hi Lucd,

    I've configured the script according to my need and it works awesome.

    I've used rvtools password encryption feature in 3.9.5 to protect my password as well

    As rvtools report generation takes time and before the completion of rvtools report generation the sendsmtp got executed

    Hence i introduced start -sleep 500 before the smtp code

    Thanks



  • 5.  RE: RVTOOLS Automation

    Posted Sep 05, 2024 04:40 AM

    Hi,

    I ran the script and getting the following error: -

    Error: Export failed! RVTools returned exitcode -1, probably a connection error! Script is stopped

    Though connectivity from the server to the vcenter is working ok..
    Can u pls let me know what I am missing...




  • 6.  RE: RVTOOLS Automation

    Posted Sep 05, 2024 04:41 AM

    Without seeing any code it is difficult to analyse your issue.



    ------------------------------


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


    ------------------------------



  • 7.  RE: RVTOOLS Automation

    Posted Sep 05, 2024 05:31 AM

    Please find below:-

    # Save current directory
    $SaveCurrentDir = (get-location).Path

    # Set RVTools path
    [string] $RVToolsPath = "C:\Program Files (x86)\Dell\RVTools"

    # cd to RVTools directory
    set-location $RVToolsPath


    # -----------------------------------------------------
    # Set parameters for vCenter 1 and start RVTools export
    # -----------------------------------------------------
    [string] $VCServer = "10.200.242.175"                                                    # my test vCenter server
    [string] $User = "vsphere.local\administrator"                                                    

    [string] $XlsxDir1 = "C:\Users\admin\Desktop\New folder"
    [string] $XlsxFile1 = "vCenter1.xlsx"

    # Start cli of RVTools
    Write-Host "Start export for vCenter $VCServer" -ForegroundColor DarkYellow
    $Arguments = "-u $User -p /***/ -s $VCServer -c ExportAll2xlsx -d $XlsxDir1 -f $XlsxFile1"

    Write-Host $Arguments

    $Process = Start-Process -FilePath ".\RVTools.exe" -ArgumentList $Arguments -NoNewWindow -Wait -PassThru

    if($Process.ExitCode -eq -1)
    {
        Write-Host "Error: Export failed! RVTools returned exitcode -1, probably a connection error! Script is stopped" -ForegroundColor Red
        exit 1
    }


    $OutputFile = "C:\Users\admin\Desktop\New folder\vCenter1.xlsx"


    # Back to starting dir
    Set-Location $SaveCurrentDir




  • 8.  RE: RVTOOLS Automation

    Posted Sep 05, 2024 06:23 AM

    Seems to work for me.
    The only explanation I can think of is that the password is not correct.



    ------------------------------


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


    ------------------------------



  • 9.  RE: RVTOOLS Automation

    Posted Sep 06, 2024 03:05 AM

    Hi @IFSC SYSAD GIFT CITY

    Maybe it would be better to open a new Ticket and not add to a  content to a 7 Year old Ticket ,  my2Cent. 

    As you didnt included  much info on the circumstances , there could be also a Bug hitting you . 

    https://knowledge.broadcom.com/external/article/318142/export-data-failure-sorry-the-data-could.html