PowerShell script exchange
Post Reply
Michel121
Novice
Posts: 6
Liked: never
Joined: Nov 24, 2022 7:24 pm
Full Name: Michel
Contact:

[Request]

Post by Michel121 »

Hello everyone,

I would like to auto start Veeam backup jobs when an external hard drive is plugged in.
Plus I need it to auto check if all jobs were successful, then eject the hard drive.

thanks in advance
HannesK
Product Manager
Posts: 14836
Liked: 3083 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: [Request]

Post by HannesK » 1 person likes this post

Hello,
and welcome to the forums.

As you posted in the PowerShell forum, the first step would be to start a script when the USB drive is connected. Here is an example (first Google hit)

The script then can start a backup job with start-vbrjob

ejecting the drive can be done as post-job script

With get-vbrjob, you can get the last result (Google / forum search should also give some "ready to use" scripts)

Best regards,
Hannes
PS: check the "rotated drives" checkbox in the repository settings
Michel121
Novice
Posts: 6
Liked: never
Joined: Nov 24, 2022 7:24 pm
Full Name: Michel
Contact:

Re: [Request]

Post by Michel121 »

Thanks you so much.
albertwt
Veteran
Posts: 941
Liked: 53 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: [Request]

Post by albertwt »

Hi @Hannes,

Is using the PowerShell script as a post and pre-backup script a supported scenario when we troubleshoot some issues with the Veeam support team?
--
/* Veeam software enthusiast user & supporter ! */
HannesK
Product Manager
Posts: 14836
Liked: 3083 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: [Request]

Post by HannesK »

Hello,
If you ask, whether Veeam support helps when customers are using pre & post scripts, then the answer is "yes".

If you ask, whether Veeam support will write / check / troubleshoot customer's scripts, then the answer is "no".

Best regards,
Hannes
albertwt
Veteran
Posts: 941
Liked: 53 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: [Request]

Post by albertwt »

That's great, it's all I need.

Thanks, Hannes.
--
/* Veeam software enthusiast user & supporter ! */
Michel121
Novice
Posts: 6
Liked: never
Joined: Nov 24, 2022 7:24 pm
Full Name: Michel
Contact:

Re: [Request]

Post by Michel121 »

I followed the links you gave me and everything is working perfectly

I am using the following command : Get-VBRJob -Name "test" | Start-VBRJob -StartChainedJobs

now my question is: how can I run this command on a network device. for example something like this:

Get-VBRJob \\Veaam-Server -Name "test" | Start-VBRJob -StartChainedJobs
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: [Request]

Post by oleg.feoktistov »

Hi Michel,

If you want to execute veeam powershell commands remotely, you need to install VBR console on the server you want to run commands from, use Connect-VBRServer cmdlet to establish connection to a VBR server instance and then invoke cmdlets like you usually do. They will be executed in scope of the remote connection.

Once you sent all the commands you needed, use Disconnect-VBRServer to stop remote session.

Best regards,
Oleg
Michel121
Novice
Posts: 6
Liked: never
Joined: Nov 24, 2022 7:24 pm
Full Name: Michel
Contact:

Re: [Request]

Post by Michel121 »

thank you. that is exactly what I needed.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests