PowerShell script exchange
Post Reply
fidelitylife
Lurker
Posts: 2
Liked: never
Joined: Mar 08, 2010 6:43 pm
Full Name: Graeme Thomas
Contact:

How to use Start-VBRHvRestoreVM (Case #00740993)

Post by fidelitylife »

There don't seem to be any examples of how to use this cmdlet.
On the support case they put me right that for HyperV one uses this cmdlet rather than 'Start-VBRRestoreVM'; however I cannot seem to invoke this without getting 'Start-VBRHvRestoreVM : Exception has been thrown by the target of an invocation.'.

I use '$restorePoint = Get-VBRRestorePoint -Name 'aserver' | Sort-Object -Property creationtime | Select-Object -Last 1' to get the latest restore point for the server - this does return an object which describes the latest restore point of the VM in question.
I use ''$restoreHost = Get-VBRServer -Type hvserver -Name 'ahost' to get a host HyperV 2012 R2 server (note, server is a member of a cluster; I also tried with the cluster object rather than the server) - this does return an object which describes the host in question.
Then boiled down just calling with 'Start-VBRHvRestoreVM -RestorePoint $restorePoint -Server $restoreHost -Path 'c:\clusterstorage\acsv'' to which I get the above error.

Anyone successfully used this cmdlet, and able to supply some examples or advice?

Cheers.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to use Start-VBRHvRestoreVM (Case #00740993)

Post by veremin » 1 person likes this post

Can you execute the said script under admin account? Thanks.
fidelitylife
Lurker
Posts: 2
Liked: never
Joined: Mar 08, 2010 6:43 pm
Full Name: Graeme Thomas
Contact:

Re: How to use Start-VBRHvRestoreVM (Case #00740993)

Post by fidelitylife »

Nailed it; thanks - I should have thought of that.

Cheers.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to use Start-VBRHvRestoreVM (Case #00740993)

Post by veremin »

Based on my experience, whenever you have "Exception has been thrown by the target of an invocation", while working with script that looks good, it typically means you run a script under account with insufficient rights.

Anyway, glad to hear that everything works now as expected. Should other help be needed, don't hesitate to let us know.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests