PowerShell script exchange
Post Reply
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

VeeamBackup RemotePowershell

Post by Avshalom »

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
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: VeeamBackup RemotePowershell

Post by Vitaliy S. »

Hello Avshalom,

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

Thank you!
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

Re: VeeamBackup RemotePowershell

Post by Avshalom »

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
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: VeeamBackup RemotePowershell

Post by Vitaliy S. »

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.
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

Re: VeeamBackup RemotePowershell

Post by Avshalom »

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

Re: VeeamBackup RemotePowershell

Post by Avshalom »

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

Re: VeeamBackup RemotePowershell

Post by veremin »

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.
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

Re: VeeamBackup RemotePowershell

Post by Avshalom »

thanks v.Eremin
i'm using powershell v3
can you explain the $using trick?
thanks
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VeeamBackup RemotePowershell

Post by veremin »

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.
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

Re: VeeamBackup RemotePowershell

Post by Avshalom »

thanks man,
but how i'm passing variable from the remote session to the local session back?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: VeeamBackup RemotePowershell

Post by veremin »

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.
Avshalom
Influencer
Posts: 18
Liked: never
Joined: Mar 30, 2014 8:00 am
Full Name: Avshalom
Contact:

Re: VeeamBackup RemotePowershell

Post by Avshalom »

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

Re: VeeamBackup RemotePowershell

Post by veremin »

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

Who is online

Users browsing this forum: No registered users and 14 guests