Cannot restore to original location using PowerShell

PowerShell script exchange

Cannot restore to original location using PowerShell

Veeam Logoby vmm » Thu Nov 26, 2015 5:24 pm

Hi.

We have a problem with restoring a VM to its original location using parameter -ToOriginalLocation.

When we issue the command:
Code: Select all
Start-VBRRestoreVM -RestorePoint $rrr -Server 10.242.4.26

we can do it

But when we issue the command:

Code: Select all
Start-VBRRestoreVM -RestorePoint $rrr -Server 10.242.4.26 -ToOriginalLocation


or

Code: Select all
Start-VBRRestoreVM -RestorePoint $rrr -Server 10.242.4.26 -PowerUp $TRUE -ToOriginalLocation


we get an error:

Code: Select all
Start-VBRRestoreVM : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Start-VBRRestoreVM -RestorePoint $rrr -Server 10.242.4.26 -ToOriginalLocation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Start-VBRRestoreVM], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Veeam.Backup.PowerShell.Command.StartVBRRestoreVM
vmm
Service Provider
 
Posts: 15
Liked: never
Joined: Mon Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov

Re: Cannot restore to original location using PowerShell

Veeam Logoby v.Eremin » Fri Nov 27, 2015 9:28 am

Since you're restoring VM to original location, try to disregard -Server parameter, as it's not needed here:

Code: Select all
Start-VBRRestoreVM -RestorePoint $rrr -ToOriginalLocation


Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Cannot restore to original location using PowerShell

Veeam Logoby vmm » Fri Nov 27, 2015 10:02 am

Code: Select all
PS C:\Users\Administrator> Start-VBRRestoreVM -RestorePoint $rrr -ToOriginalLocation
Start-VBRRestoreVM : Object reference not set to an instance of an object.
At line:1 char:1
+ Start-VBRRestoreVM -RestorePoint $rrr -ToOriginalLocation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-VBRRestoreVM], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Veeam.Backup.PowerShell.Command.StartVBRRestoreVM
vmm
Service Provider
 
Posts: 15
Liked: never
Joined: Mon Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov

Re: Cannot restore to original location using PowerShell

Veeam Logoby v.Eremin » Fri Nov 27, 2015 10:10 am

Try to run the script under the account with administrative privileges.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Cannot restore to original location using PowerShell

Veeam Logoby vmm » Fri Nov 27, 2015 10:42 am

Doesn't work. The issue is the same.
vmm
Service Provider
 
Posts: 15
Liked: never
Joined: Mon Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov

Re: Cannot restore to original location using PowerShell

Veeam Logoby v.Eremin » Fri Nov 27, 2015 11:09 am

In overwhelming majority of cases it's related to lack of permissions. If running script as administrator doesn't resolve that, open a ticket with our support team and let them investigate it directly. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Cannot restore to original location using PowerShell

Veeam Logoby tsightler » Sat Nov 28, 2015 6:27 am

I probably suggest this too often, but any chance this is on Windows 2008R2 with default Powershell 2.0? I've seen a lot of strange issues like this until Powershell is upgraded to at least 3.0.
tsightler
Veeam Software
 
Posts: 4769
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler


Return to PowerShell



Who is online

Users browsing this forum: Bing [Bot] and 2 guests