VeeamBackup RemotePowershell

PowerShell script exchange

VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Sun Mar 30, 2014 8:06 am

Hello guys,
can you please help me with how to connect to the veeam backup server through remote powershell,
locally on the veeam server it's working fine, but I want to be able to connect the veeam server powershell from different server and manage it from there.

also, is there a way to install the GUI Client on a remote computer as well?

As you understand i want to manage the veeam backup server from remote computer, through powershell mainly and the GUI.

Please help,

Thanks a lot in advance
Avshalom
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby Vitaliy S. » Sun Mar 30, 2014 12:52 pm

Hello Avshalom,

Please review these topics for the answer > Remote PowerShell and PowerShell scripts do not start on Win2k8

Thank you!
Vitaliy S.
Veeam Software
 
Posts: 19558
Liked: 1102 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Sun Mar 30, 2014 1:06 pm

Thanks Vitaliy
Already seen that, But it not helping me just a mix of information.
my question is very simple but i can't found a simple solution though.
what are the first steps? what to do on the veeam server, what to do on the remote client server,
and my 2nd question, is there a possibility to run the veeam gui from remote machine?
Thanks again
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby Vitaliy S. » Sun Mar 30, 2014 8:06 pm

Avshalom wrote:what to do on the veeam server

On the backup server you should run one of these:

Code: Select all
Set-ExecutionPolicy Unrestricted

Code: Select all
Set-ExecutionPolicy RemoteSigned

Avshalom wrote:what to do on the remote client server

Start PS remote session and load VeeamPSSnapIn > Remote PowerShell
Avshalom wrote:and my 2nd question, is there a possibility to run the veeam gui from remote machine?

No, that's not possible. Veeam backup console can only be opened on the backup server.
Vitaliy S.
Veeam Software
 
Posts: 19558
Liked: 1102 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Tue Apr 22, 2014 8:01 am

Thanks for your help
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Thu May 22, 2014 7:02 am

Hello Guys,
Can you please help me with the following issue:

i want to import the veeam-pssnapin from remote computer, when i do:
Enter-PSSession servername ->
Add-PSSnapin VeeamPSSnapIn
i can run the veeam cmdlets, that's fine,

but i have 3 problems,
1. i can't share/pass the variables between the two sessions- the local and remote
2. if i try to import the session - the VeeamPSSnapIn is not loaded, maybe because it's not loaded by default in the remote server..
3. if i try to import the modules, i'm trying to run [ Get-Module -PSSession $session -ListAvailable ] but i'm not see the VeeamPSSnapIn in the list

can you tell me how can i import the cmdlets from the remote server to the local session, just like AD cmdlets etc.

any help will be very helpful...
thanks again
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby v.Eremin » Thu May 22, 2014 9:24 am

What is the PS version you're currently at? In PowerShell 3.0, you can pass local variables to remote session via $Using scope. Is that what you're after? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Thu May 22, 2014 10:21 am

thanks v.Eremin
i'm using powershell v3
can you explain the $using trick?
thanks
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby v.Eremin » Thu May 22, 2014 10:58 am

As mentioned in the referenced article, $Using scope allows you to pass locally create variables to remote session. Say, there is a local variable called $LocalVariable that you want to use in remote session. In order to do so, you should use the following syntax:

Code: Select all
$LocalVariable = "Something"
Invoke-Command -ComputerName Server01 -ScriptBlock { Write-Output "The value of `$LocalVariable is: $using:LocalVariable"}


The result will be:

Code: Select all
The value of $LocalVariable is: Something


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Thu May 22, 2014 11:05 am

thanks man,
but how i'm passing variable from the remote session to the local session back?
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby v.Eremin » Thu May 22, 2014 11:30 am

You can write remote session into variable. The created variable should contain internal variables used inside remote session. See this post for further explanation. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: VeeamBackup RemotePowershell

Veeam Logoby Avshalom » Thu May 22, 2014 11:41 am

thanks but as far as i see, this way the variable not exist in the local scope, just shown in the remote session...
anyway is there's a way to import the cmdlets into the local session?
or get the veeamsnappin as a module? so i can import it?
thanks for your help
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: VeeamBackup RemotePowershell

Veeam Logoby v.Eremin » Fri May 23, 2014 8:53 am

Anyway is there's a way to import the cmdlets into the local session?

You mean you want to install VB&R snap-in on local server, right? Do you have backup server installed locally? I'm wondering because bare commandelts without management server would be useless.

Anyway, you can run install wizard again and chose PS snap-in as an additional component.

thanks but as far as i see, this way the variable not exist in the local scope, just shown in the remote session...

With the proposed method the session variable will contain the value of variable used inside session. This value can be, then, passed to whatever local variable you want to.

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests