PowerShell script exchange
Post Reply
HenryA
Enthusiast
Posts: 37
Liked: 4 times
Joined: Aug 16, 2023 5:31 pm
Full Name: Henry Aragon
Contact:

Is it possible to get the settings of File Share Backups with PowerShell?

Post by HenryA »

Good day everyone.

Scenario: Let's say I have 5 shares that are being backed up with "NAS Filer" option. The shares being backed up have some similar settings but also some different settings: Example:

- \\share1: Backed up daily at 7pm. Retention period of 4 months. Compressed with optimal settings. Encrypted using account "Encrypt1" to local repository. Consistency check every Saturday of the beginning of the month.

- \\share2: Backed up weekly at 10pm. Retention period of 8 months. Compressed with optimal settings. Encrypted using account "EncryptAccount2" to an S3 bucket repository. Consistency check every Saturday of the beginning of the month.

I can manually look at all the settings, but that takes a long time. Is there any way to pull a report, let's say to a CSV file, with the exact details of the Job Settings for every share?

And then the hope is to use another script to create let's say 20 more backup jobs: I have 20 shares I'd like to back up. I can either create a job per share manually, which takes a long time, or I can create a CSV and put all the backup job settings for every share in it, exactly as I want it, and then just run the script, saving a lot of time.

I assume this is possible? I'm not sure if PowerShell is the correct way to do it, or if there's another way to do these two tasks. I'd appreciate some insight :)
david.domask
Veeam Software
Posts: 2744
Liked: 630 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Is it possible to get the settings of File Share Backups with PowerShell?

Post by david.domask »

Hi Henry,

You can do this with a combination of Get-VBRUnstructuredBackupJob and Set-VBRNasBackupJob. For creating new jobs, you can also use Add-VBRNasBackupJob to create new jobs.

Check the properties and the cmdlet help page for both cmdlets -- you will be able to pull out the relevant options from the CVBRNASBackupJob object returned by Get-VBRUnstructuredBackupJob, and then create a list of items to set for the parameters for Set/Add-NewVBRNasBackupJob.

Give it a shot and if you hit some bumps, show us what you have and we'll assist. Do review the parameters you want to set, as some require that you use other cmdlets first to create the required input for the parameter (e.g., schedule options require New-VBRServerScheduleOptions to create an object for the parameter)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests