PowerShell script exchange
Post Reply
DavidCole
Novice
Posts: 4
Liked: never
Joined: Nov 06, 2012 9:52 pm
Full Name: David Cole
Contact:

Import-VBRBackup is not my friend

Post by DavidCole » May 03, 2013 8:52 pm

Greetings all,

I'm trying to get a scheduled restore going at our DR site. We replicate all of the backups over using a pair of DataDomain boxes, and when I restore using the console it works fine. Unfortunately, I think that the only way to get a scheduled restore going is to script it through powershell, and I'm running in to a problem.

I do have a case opened on this, so if support gets back to me I'll update with the solution. The case number is 00203432.

What I'm currently testing to import is:

Code: Select all

Add-PSSnapin -Name VeeamPSSnapin
Net Use Z: /Delete
Net Use Z: \\DDServerName\Veeam /User:AUser ThisisNOTthePassword
$sVeeamBackup = "Z:\Exchange\ExchangeBackupFileName.vbk"
$sVeeamServer = Get-VBRServer | where {$_.Type -eq "Local"}
Import-VBRBackup -Server $sVeeamServer -FileName $sVeeamBackup
What I get back is an error:
Path[z:\Exchange\ExchangeBackupFileName.vbk] not found.
In my testing I have tried running the commands from the Z:\Exchange folder, so I know the file path is working. I've also tried just calling the filename from Powershell, which causes the restore function to start in the GUI, which makes me pretty sure the file is there...

Has anyone else seen this problem? If so, how did you get past it?

Thanks,

D

tsightler
VP, Product Management
Posts: 5377
Liked: 2211 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Import-VBRBackup is not my friend

Post by tsightler » May 03, 2013 9:42 pm

I would say that it's probably mapped drives that are not you friend. :lol:

Since Veeam is running as a service it cannot see mapped drives because they run in the context of the user login. I'm guessing you are trying to do this because of the requirement to use a local DataDomain username/password to get access to the share.

I'd suggest a slightly different approach. I'm assuming you have a Veeam server at the DR site, on this Veeam server configure a CIFS repository that points at the DataDomain at the DR site, this will let you enter the appropriate credentials. Now you can refresh the repository with the current backups using the following Powershell:

Code: Select all

Get-VBRBackupRepository -Name <Name_of_Repo> | Sync-VBRBackupRepository
This will automatically rescan and import any backups in the repository using the saved credentials on the Veeam server, then you can script the actual restore process.

DavidCole
Novice
Posts: 4
Liked: never
Joined: Nov 06, 2012 9:52 pm
Full Name: David Cole
Contact:

Re: Import-VBRBackup is not my friend

Post by DavidCole » May 03, 2013 10:32 pm

Thank you tsightler. :D

Yes, using the current tools to do the job actually (gasp!) works.

Okay, now back to my scripting restores.

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

Re: Import-VBRBackup is not my friend

Post by veremin » May 06, 2013 8:33 am

Okay, now back to my scripting restores.
Do you experience any issues with scripting it? If so, don’t hesitate let us know, and we’ll try our best to help you.

Thanks.

DavidCole
Novice
Posts: 4
Liked: never
Joined: Nov 06, 2012 9:52 pm
Full Name: David Cole
Contact:

Re: Import-VBRBackup is not my friend

Post by DavidCole » May 06, 2013 5:09 pm

Working up the script to do the restores wasn't too bad. I have come up with a new error, which I will create as a different discussion thread.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests