PowerShell script exchange
Post Reply
jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

How to add Agent Backup Job

Post by jed-hyper » Mar 09, 2018 12:00 am

I'm starting to write a script for the setup and execution of an Windows Agent backup
I can't find the powershell command to Add Agent Backup Job
Is this supported in Veeam Backup & Replication 9.5 Update3 (9.5.0.1536) ?

tdewin
Veeam Software
Posts: 1462
Liked: 466 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How to add Agent Backup Job

Post by tdewin » Mar 09, 2018 7:31 am

Unfortunately not everything is possible today with PowerShell in combination with the Veeam Agent:
https://helpcenter.veeam.com/docs/backu ... tml?ver=95

However I'm sure product management is taking this in consideration for the future

veremin
Product Manager
Posts: 17075
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to add Agent Backup Job

Post by veremin » Mar 09, 2018 1:46 pm

Correct, we do plan to support this in the next product update. Thanks.

tdewin
Veeam Software
Posts: 1462
Liked: 466 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: How to add Agent Backup Job

Post by tdewin » Mar 09, 2018 1:49 pm

BTW one thing that is possible is that you use a CSV file in your protection group. If you then need to add new machines, you can just add FQDN's / IPs to the CSV file. The protection group will then pick them up later

vguinot@safehost.com
Lurker
Posts: 1
Liked: never
Joined: Apr 07, 2016 9:02 am
Full Name: Vincent Guinot
Contact:

Re: How to add Agent Backup Job

Post by vguinot@safehost.com » Mar 20, 2018 10:34 am

We are using PowerShell to integrate the results of jobs in our own CRM, so I'm eager to see this feature included. Can you communicate a rough timeframe for the next update ?

kevin@wei.com
Influencer
Posts: 14
Liked: 4 times
Joined: Apr 04, 2012 8:49 pm
Full Name: Kevin Wood
Contact:

Re: How to add Agent Backup Job

Post by kevin@wei.com » Mar 27, 2018 1:23 pm

I'm very interested in this for the Linux Agent as well. We have a customer that is using the Linux agents to backup servers at roughly 80+ stores. I have written the powershell code to build all the protection groups and add the necessary servers, but I can't take it to the next level of building out the backup jobs, unless someone has a trick I'm not aware of.

veremin
Product Manager
Posts: 17075
Liked: 1475 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to add Agent Backup Job

Post by veremin » Mar 28, 2018 1:12 pm

Unfortunately, you cannot configure agent backup jobs via PowerShell. The functionality is coming in the next update. Thanks.

jhoughes
Veeam Software
Posts: 119
Liked: 31 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: How to add Agent Backup Job

Post by jhoughes » Mar 31, 2018 11:03 am

I'm absolutely looking to control our agent jobs with PowerShell, would love to be able to include an example of the functionality into my presentation for VeeamOn.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

sparky.spb
Veeam Software
Posts: 1
Liked: 1 time
Joined: May 15, 2015 2:19 pm
Full Name: Dmitry.Shumilov
Contact:

Re: How to add Agent Backup Job

Post by sparky.spb » Jul 04, 2019 8:50 am 1 person likes this post

Just in case, starting from 9.5u4 you can create a Veeam agent backup job via PowerShell using the following instruction:
https://helpcenter.veeam.com/docs/backu ... l?ver=95u4

Here is an example:

# add Veeam Powershell snapins
Add-PSSnapin VeeamPSSnapin

# Job Name
$job_name = "My new job"

# Protectiopn group to add to job
$protection_group = "My protection group"

# Included directories
$include_dirs = "/etc,/root,/home"

# Excluded directories
$exlude_dirs = "/etc/,/home/dummy"

# Veeam backup repo
$repository = Get-VBRBackupRepository -Name "Default Backup Repository"
$destination = New-VBRComputerDestinationOptions -OSPlatform Linux -BackupRepository $repository

# Schedule plan
$daily = New-VBRDailyOptions -Type Everyday -Period 19:10
$schedule = New-VBRServerScheduleOptions -Type Daily -DailyOptions $daily

# Backup retention
$retention = 35

# Encryption & Storage
$enc_key = Get-VBREncryptionKey -Description "Encryption Key"
$storage = New-VBRStorageOptions -CompressionLevel Optimal -StorageOptimizationType LANTarget -EnableEncryption -EncryptionKey $enc_key
$synthetic = New-VBRSyntheticFullOptions -Enable -Days Friday

# Notification
$notification = New-VBRNotificationOptions -EnableAdditionalNotification -AdditionalAddress user@example.com

# Create job
$source = New-VBRSelectedFilesBackupOptions -OSPlatform Linux -BackupSelectedFiles -SelectedFiles $include_dirs.split(",") -ExcludeMask $exlude_dirs.split(",")
$object = Get-VBRProtectionGroup -Name $protection_group
$indexing = New-VBRComputerIndexingOptions -OSPlatform Linux -BackupObject $object -IndexingMode IndexEverything

Add-VBRComputerBackupJob -OSPlatform Linux -Type Server -Mode ManagedByBackupServer -Name $job_name -BackupRepository $repository -BackupObject $object -BackupType SelectedFiles -SelectedFilesOptions $source -DestinationOptions $destination -ScheduleOptions $schedule -EnableSchedule -RetentionPolicy $retention -EnableIndexing -IndexingOptions $indexing -SyntheticFullOptions $synthetic -NotificationOptions $notification -StorageOptions $storage

jhoughes
Veeam Software
Posts: 119
Liked: 31 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: How to add Agent Backup Job

Post by jhoughes » Jul 04, 2019 11:50 am

Yes, I covered the new functionality in my automation session at VeeamON 2019, to show the full cycle of deployment and job creation/scheduling.

Thanks for following up with posting that and adding the documentation link. I had forgotten to update this thread.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests