PowerShell script exchange
Post Reply
Cathy
Influencer
Posts: 16
Liked: never
Joined: Jun 13, 2014 3:48 am
Full Name: Cathy Hu
Contact:

Could we stop restoring VM by PS?

Post by Cathy »

We want to stop restoring VMs. Now we try to use "Remove-VBRRestoreSession" to do it.
However, we try:
1. Get-VBRRestoreSession -Name "zhouzhengguang"|select -last 1|Remove-VBRRestoreSession
2. $session=Get-VBRRestoreSession -Name "zhouzhengguang"|select -last 1
Remove-VBRRestoreSession -Session $session
both get "This cmdlet is obsolete" .

We use Veeam B&R v7 with patch 4. From document, we know Remove-VBRRestoreSession should work with this version. Or we should use other cmdlet? (Or, could we stop restoring VM by powershell?)
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Could we stop restoring VM by PS?

Post by veremin »

You should use Stop-VBRWindowsfilerestore commandlet. In order to stop restore session, you should execute restore from PS first and assign the resulting session to a variable.

Thanks.
TrueAlex
Novice
Posts: 3
Liked: never
Joined: Nov 09, 2015 2:06 pm
Contact:

Re: Could we stop restoring VM by PS?

Post by TrueAlex »

Is there any way to close restore session which is started from GUI?
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Could we stop restoring VM by PS?

Post by veremin »

I'm afraid, no. The Windows FLR session should be executed first via PS and assigned to a variable. Thanks.
jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Could we stop restoring VM by PS?

Post by jed-hyper »

Hi, I'd also like to be able to run Stop-VBRWindowsFileRestore on a restore that was started from the GUI
If an admin starts a restore from the GUI and forgets to close it it is stopping parts of my powershell scripts from running.
Is there already a feature request for this.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Could we stop restoring VM by PS?

Post by veremin »

There is a system variable called $FLRSessions. Using it, you can list of all currently running FLR sessions and, then, stop required ones with Stop-VBRWindowsFileRestore cmdlet. Thanks.
jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Could we stop restoring VM by PS?

Post by jed-hyper »

Is there a link to information on how to use $FLRSessions
I have tried running this powershell command and it returns nothing

Code: Select all

Add-PSSnapin -Name VeeamPSSnapin
Connect-VBRServer -Server 'localhost'
$FLRSessions
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Could we stop restoring VM by PS?

Post by veremin »

Sorry, I have provided a bit misleading information. $FLRSessions do not reflect sessions started from GUI, only sessions executed within PS console.

So, unfortunately, there doesn't seem to be a way to achieve what you are after.

Thanks.
jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Could we stop restoring VM by PS?

Post by jed-hyper »

Ah bugga, that's annoying, i was excited for a sec.
Is there already a feature request for this ?
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Could we stop restoring VM by PS?

Post by veremin »

This request has been there for a while. Based on preliminary technical expertise, adding corresponding cmdlet didn't not seem like a trivial task, so we postponed the implementation.

Thank you for the feedback, though, much appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests