Veeam PowerShell to view backup job configuration ?

PowerShell script exchange

Veeam PowerShell to view backup job configuration ?

Veeam Logoby albertwt » Tue Jun 14, 2016 6:36 am

Hi All,

Is there any Veeam PowerShell script to list the current backup job settings ?

I need to standardize around 70+ backup job method from Reverse Incremental to Forward Incremental and also check the Bitlooker has been enabled or not.

just like the other PowerShell use case scenario, the easiest way is to list them in a CSV or in a table format, so I wonde if this is possible.

Thanks,
--
/* Veeam software enthusiast user & supporter ! */
albertwt
Expert
 
Posts: 607
Liked: 19 times
Joined: Thu Nov 05, 2009 12:24 pm
Location: Sydney, NSW

Re: Veeam PowerShell to view backup job configuration ?

Veeam Logoby vmniels » Tue Jun 14, 2016 7:14 am 1 person likes this post

The following script can help you here:

Code: Select all
asnp VeeamPSSNapin
foreach ($Job in Get-VBRJob | where { $_.JobType -eq "Backup" }) {
    Write-Host $Job.Name " - " $Job.BackupTargetOptions.Algorithm "(" $Job.BackupTargetOptions.TransformFullToSyntethic ") - " $Job.ViSourceOptions.DirtyBlocksNullingEnabled
}


It will list the following:
"Job Name" - "Method: increment or synthetic (which is reverse incremental) (Syntethic enabled yes/no) - "BitLooker yes/no"

You can enable BitLooker via PowerShell as well.

Enable forever foward incremental add the following to the BitLooker script or in the foreach loop above:
Code: Select all
$Options = $Job.GetOptions()

    # Change method to Forever forward incremental
    $Options.BackupTargetOptions.Algorithm = "Increment"
    $Options.BackupTargetOptions.TransformFullToSyntethic = $False
VCP-DCV
Veeam Certified Engineer
http://foonet.be
vmniels
Veeam Software
 
Posts: 1509
Liked: 325 times
Joined: Mon Jul 15, 2013 11:09 am
Full Name: Niels Engelen

Re: Veeam PowerShell to view backup job configuration ?

Veeam Logoby albertwt » Tue Jun 14, 2016 7:34 am

Thanks Niels,

I can see the result as follows:
SQL Servers 3 - Syntethic ( True ) - False
DC Servers 1 - Increment ( False ) - True

So:

1. Why there is no mention about the Reverse or Forward incremental ?
2. Is it possible to export the list to .CSV file ?
--
/* Veeam software enthusiast user & supporter ! */
albertwt
Expert
 
Posts: 607
Liked: 19 times
Joined: Thu Nov 05, 2009 12:24 pm
Location: Sydney, NSW

Re: Veeam PowerShell to view backup job configuration ?

Veeam Logoby vmniels » Tue Jun 14, 2016 8:36 am 2 people like this post

1. If it lists synthethic it means the job is using Reverse incremental.
If it says Increment (False) it means it is using Forever forward incremental.
If it says Increment (True) it means it is using Forward incremental with syntethic fulls.

2. Try the following:
Code: Select all
asnp VeeamPSSNapin
$OutArray = @()
foreach ($Job in Get-VBRJob | where { $_.JobType -eq "Backup" }) {
    #Write-Host $Job.Name " - " $Job.BackupTargetOptions.Algorithm "(" $Job.BackupTargetOptions.TransformFullToSyntethic ") - " $Job.ViSourceOptions.DirtyBlocksNullingEnabled

    # Create a new custom object to hold our result.
    $jobObject = new-object PSObject

    # Add our data to $jobObject as attributes using the add-member commandlet
    $jobObject | Add-Member -membertype NoteProperty -name "Name" -Value $Job.Name
    $jobObject | Add-Member -membertype NoteProperty -name "Method" -Value $Job.BackupTargetOptions.Algorithm
    $jobObject | Add-Member -membertype NoteProperty -name "Syntethic" -Value $Job.BackupTargetOptions.TransformFullToSyntethic
    $jobObject | Add-Member -membertype NoteProperty -name "BitLooker" -Value $Job.ViSourceOptions.DirtyBlocksNullingEnabled

    # Save the current $jobObject by appending it to $OutArray
    $OutArray += $jobObject

    #$Options = $Job.GetOptions()

    # Change method to Forever forward incremental
    #$Options.BackupTargetOptions.Algorithm = "Increment"
    #$Options.BackupTargetOptions.TransformFullToSyntethic = $False

    # Enable BitLooker:
    #$Options.ViSourceOptions.DirtyBlocksNullingEnabled = $True
    #$Job.SetOptions($Options)
}

$OutArray | export-csv "c:\output.csv"
VCP-DCV
Veeam Certified Engineer
http://foonet.be
vmniels
Veeam Software
 
Posts: 1509
Liked: 325 times
Joined: Mon Jul 15, 2013 11:09 am
Full Name: Niels Engelen

Re: Veeam PowerShell to view backup job configuration ?

Veeam Logoby albertwt » Tue Jun 14, 2016 10:59 pm

Whoa, many thanks Niels for the assistance.
I never thought that it is possible with Veeam Powershell.
--
/* Veeam software enthusiast user & supporter ! */
albertwt
Expert
 
Posts: 607
Liked: 19 times
Joined: Thu Nov 05, 2009 12:24 pm
Location: Sydney, NSW


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests