This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Customise VRanger Email Reports

Hi everyone.

Is there anyway to modify the default email report which VRange sends? I would like to make some changes to a few parts of it but most importantly to the subject. The main reason I am asking is we have a Office 365 Group which we track all of our reporting in for our team and all reports are listed as a single thread since they all have the same email subject. This means if I want to say look at 'Active Directory Status Reports' I click that thread and can browse back years if I want. However due to the way VRanger puts the date and server name in the email subject each email creates it's own thread and throws off our nice way of tracking reports for auditing purposes using Office 365 Groups. The same problem exists with Microsoft Teams as well. It would be nice if we could at least edit the subject line for these emails so we could customise them enough that they would work better with many of the Office 365 products which are out now. 

  • Ok so no responses here but no worries I came up with a solution and thought I'd share it here for anyone else who might be having a similar issue. The solution is to use the Powershell cmdlets and just write a report yourself. I wrote a small script to pull the status of all backup jobs which finished in the past 24 hours. I then pipe that into another script I have that formats the data and emails it to a shared team mailbox. Here is the basic code which does all the work. The last few lines just output the data to the screen but you can do with it whatever you want (put it in an email, put it in a CSV, etc)

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

    # Load vRanger Snap-in
    Add-PSSnapin vRanger.API.PowerShell

    $CompletedJobList = Get-Job | Where-Object {$_.JobState -eq "Completed" -and $_.CompletedOn -gt ((Get-Date).AddHours(-24))}

    Foreach ($Job in $CompletedJobList) {

    $Started = $Job.StartedOn
    $Completed = $Job.CompletedOn
    $JobDetails = Get-JobTemplate | Where-Object {$_.templateversionid -eq $Job.ParentJobTemplateID}

    $JobName = $JobDetails.JobName
    $JobState = $Job.JobState
    $JobStatus = $Job.JobStatus

    $TimeDiff = New-TimeSpan $Started $Completed
    $Days = $TimeDiff.Days
    $Hrs = $TimeDiff.Hours
    $Mins = $TimeDiff.Minutes
    $Secs = $TimeDiff.Seconds
    $Duration = '{0:00}:{1:00}:{2:00}' -f $Hrs,$Mins,$Secs

    # Output the results

    write-host $JobName
    write-host $JobStatus
    write-host $JobState
    write-host $Started
    write-host $Completed
    write-host $Days $Duration
    }

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

    The website here is changing my formatting so sorry about the lack of indentation. I hope anyone else with a similar issue is able to sort it out using this method. If anyone has a better solution or wants to extrapolate on that code feel free.