PowerShell script exchange
Post Reply
mcoquereau
Lurker
Posts: 2
Liked: never
Joined: May 24, 2023 12:10 pm
Contact:

VBR 12: Configure over Powershell a VMware VM with PostgreSQL Instance the Job Guest Processing parameters

Post by mcoquereau »

Hello,

I want to automate over Powershell the configuration of a Virtual Machine that contains a PostgreSQL Instance.

The configuration in the job is :
  • In Guest Processing, tick "Enable application-aware processing" (1)
  • After, in Application(2), edit VM(3), tab "PostgreSQL"(4), affect the right credential to use for backup DB(5).
Image
Image
Image

I saw the instructions "New-VBRPostgreSQLProcessingOptions", "Set-VBRPostgreSQLProcessingOptions" and "New-VBRApplicationProcessingOptions" but they used for Computers Backup.

Is-it possible to configure these parameters with Powershell or not ?

Thanks a lot

Mathieu
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: VBR 12: Configure over Powershell a VMware VM with PostgreSQL Instance the Job Guest Processing parameters

Post by david.domask » 1 person likes this post

Hi @mcoquereau,

You will want to use the VSSOptions cmdlets here: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

New-VBRJobVSSOptions will generate a "default" VSS options that can be applied to the job or to specific objects.

Loosely, what you'd do is:

1. Use Get-VBRJob to fetch the job in question and save to some variable.
2. Get the job objects with Get-VBRJobObject, passing the job variable from step 1 to the -Job paramater
3. Save the object in question from step 2 to some variable (or call it from the index), and get its job options with Get-VBRJobObjectVSSOptions.
4. Edit the properties and items on the object from step 3 to your liking
5. Set the new options with Set-VBRJobObjectVSSOptions, passing the Object variable from step 3 and the JobObjectVSSOptions you altered in steps 3 and 4.

A loose workflow assuming that the Postgres server is called ddom-pgsql in a backup job called pgsql-backup:

Code: Select all

$job = Get-VBRJob -Name 'pgsql-backup'
$jobObjects = Get-VBRJobObjects -Job $job -Name 'ddom-pgsql'
$ObjectVSSOpts = Get-VBRJobObjectVSSOptions -Object $JobObjects
$ObjectVSSOpts.PostgresqlBackupOptions.BackupLogsEnabled = $true #this is just an example on enabling log backup, you can set anything you like
Set-VBRJobObjectVSSOptions -Object $JobObjects -Options $ObjectVSSOpts
David Domask | Product Management: Principal Analyst
mcoquereau
Lurker
Posts: 2
Liked: never
Joined: May 24, 2023 12:10 pm
Contact:

Re: VBR 12: Configure over Powershell a VMware VM with PostgreSQL Instance the Job Guest Processing parameters

Post by mcoquereau »

Hi David,

Thanks a lot for your quick reply.
It's working for me.

Mathieu
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: VBR 12: Configure over Powershell a VMware VM with PostgreSQL Instance the Job Guest Processing parameters

Post by david.domask »

Glad I could help @mcoquereau, and glad to hear it's working.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests