Maintain control of your Microsoft 365 data
Post Reply
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Start backup job via batch

Post by kontakt@roc-k-it.com »

I tried:

"C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell.Launcher.exe" -Command "& 'c:\temp\script.ps1'"

but obviously Veeam.Archiver.PowerShell.Launcher.exe does not accept such a parameter (only the Powershell IDE is started).

What is the correct syntax / the correct procedure to start an existing backup job via batch?

Many thanks
Michael
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

Hi, you can just do this via PowerShell using Start-VBOJob. No need to use any specific exe calls.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

Thanks - That's what c:\temp\script.ps1 should do:

$job = Get-VBOJob -Name "ROCKIT10_VEEAM"
Start-VBOJob -Job $job

I understood that for using VBO-statatement I have to add Import-Module Veeam.Archiver.PowerShell - But this call states:
Import-Module : Die Datei oder Assembly "file:///C:\Program Files\Veeam\Backup365\Veeam.Archiver.Client.dll" oder eine
Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.
(... C:\Program Files\Veeam\Backup365\Veeam.Archiver.Client.dll or dependancy not found).

That's why I tried Veeam.Archiver.PowerShell.Launcher.exe.

What's wrong/missing with Import-Module Veeam.Archiver.PowerShell?

Thanks again - Michael
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

Can u try: Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

Unfortunately this still gives me:

PS C:\WINDOWS\system32> Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"
Import-Module : Die Datei oder Assembly "file:///C:\Program Files\Veeam\Backup365\Veeam.Archiver.Client.dll" oder eine
Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.
In Zeile:1 Zeichen:1
+ Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], BadImageFormatException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

(... not found. It has been tried to load a file with wrong format...)

I checked: C:\Program Files\Veeam\Backup365\Veeam.Archiver.Client.dll does exist.

Thanks again - Michael
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

Does it work if you launch PowerShell from the VBO console?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

Yes (even without calling Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1")
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

Which Windows version is the VBO server running on? Can u double check you correctly installed the latest veeam explorers which came with the download?

And can u try running PowerShell as an administrator and see if that works?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

I did not describe my main goal yet: I want/need to integrate Veeam Office 365 backup into my batch based backup system. Maybe I should use another apporoach?

VBO console = Veeam Backup for Microsoft Office 365 PowerShell?
$job = Get-VBOJob -Name "ROCKIT10_VEEAM"
Start-VBOJob -Job $job
works without any problems under Veeam Backup for Microsoft Office 365 PowerShell but I can't call it from batch with parameters (see starting question).

It's running on Windows 10 Pro 1909.

I'll download the complete package again from https://www.veeam.com/de/free-backup-mi ... e-365.html (it's the community version!), reinstall and will let you know tomorrow.

I nall my attempts I ran Powershell in admin mode.

Thanks - Till tomorrow - Michael
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

So on that batch based system you will most likely need to install the VBO console to get the PowerShell module.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

Maybe I am wrong with "VBO console":

I installed Veeam Backup for Office 365 - Community Edition from https://www.veeam.com/de/free-backup-mi ... e-365.htm and that gave me 3 programs:
Veeam Backup for Microsoft Office 365 connect to...
Veeam Backup for Microsoft Office 365 PowerShell
Veeam Explorer for Microsoft Exchange

Is there an additional installation needed to install the "VBO console"?
The batch based system is running on the same machine where Veeam Backup for Office 365 is running.

Thankx again - Michael
kontakt@roc-k-it.com
Influencer
Posts: 14
Liked: never
Joined: Apr 15, 2020 2:34 pm
Full Name: Michael Rocholl
Contact:

Re: Start backup job via batch

Post by kontakt@roc-k-it.com »

Problem solved: I did run it in Powershell (x86).

If I run in Powershell (which seems to be x64) everything works fine.

Many thanks for your support
Michael

How can I mark this topic as "solved"?
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Start backup job via batch

Post by nielsengelen »

We don't have that feature on our forums. Your reply marked it as solved. Thanks for the update.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests