PowerShell script exchange
Post Reply
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

VeeamZIP

Post by marius roma »

I need to create a script to VeeamZIP a list of VMs.
Is there any sample I can start from?
Regards
marius
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: VeeamZIP

Post by tdewin » 1 person likes this post

Sure, the doc has 2 examples already:
https://helpcenter.veeam.com/docs/backu ... tml?ver=95

Code: Select all

$vm = Find-VBRViEntity -Name "Fileserver01"
$rep = Get-VBRBackupRepository -Name "Reports"
Start-VBRZip -BackupRepository $rep -Entity $vm -RunAsync

Code: Select all

$vm = Find-VBRViEntity -Name "Tech"
$netcreds = Get-VBRCredentials -Name "Shared"
Start-VBRZip -Folder "D:\Repository\VeeamZIP" -Entity $vm -Compression 4 -DisableQuiesce -NetworkCredentials $netcreds -RunAsync
veremin
Product Manager
Posts: 20411
Liked: 2300 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VeeamZIP

Post by veremin » 1 person likes this post

You can use the script mentioned here. Thanks.
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: VeeamZIP

Post by marius roma »

Many thanks for the quick answers.
Let me ask for an additional clarification: when I start VeeamZIP manualkly I specify the destination as a shared foleder that is mapped as a local disk in the Veeam server (let's say Z:\MyVeeamZip\demo ) and a username and a password to acces the share (let's say user1 ans mypassword).
How can I pass such values in Start-VBRZip ?
Regards
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: VeeamZIP

Post by tdewin » 1 person likes this post

No access to lab but I guess you need to add the credentials first with add-vbrcredentials (if they are not there yet). Adding them probably also return the object so you should be able to do something like:

Code: Select all

$netcreds = Add-VBRCredentials -Type Windows -User Administrator -Password "Password_1" -Description "Veeamzip"
However, probably you will need to add the credentials only once (maybe via the gui), and you can get them then with get-vbrcredentials

https://helpcenter.veeam.com/docs/backu ... tml?ver=95
veremin
Product Manager
Posts: 20411
Liked: 2300 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VeeamZIP

Post by veremin » 1 person likes this post

How can I pass such values in Start-VBRZip ?
You need to add them first, using the method described by Timothy. Then, refer to them, using -NetworkCredentials parameter.

Kindly, take a look at the thread provided, all of those questions have been discussed there already.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests