PowerShell script exchange
Post Reply
vmm
Service Provider
Posts: 15
Liked: never
Joined: Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov
Contact:

Cannot restore to original location using PowerShell

Post by vmm »

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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Cannot restore to original location using PowerShell

Post by veremin »

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.
vmm
Service Provider
Posts: 15
Liked: never
Joined: Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov
Contact:

Re: Cannot restore to original location using PowerShell

Post by vmm »

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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Cannot restore to original location using PowerShell

Post by veremin »

Try to run the script under the account with administrative privileges.
vmm
Service Provider
Posts: 15
Liked: never
Joined: Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov
Contact:

Re: Cannot restore to original location using PowerShell

Post by vmm »

Doesn't work. The issue is the same.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Cannot restore to original location using PowerShell

Post by veremin »

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.
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Cannot restore to original location using PowerShell

Post by tsightler »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests