-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Remote PowerShell
I can start remote PowerShell (2008R2) session, but specific Veeam commands will not run, as like extensions not installed.
Locally (on target server) I can run Veeam specific PowerShell commands.
Something missing?
Locally (on target server) I can run Veeam specific PowerShell commands.
Something missing?
-
- Chief Product Officer
- Posts: 31804
- Liked: 7298 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: Remote PowerShell
I know little about PowerShell, but I would check that you have PS 2.0 installed on both servers (since 1.0 does not support remote operations), and also if you have Veeam PS extensions installed on both. Thanks.
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
OK, found import-psession to do it.
$s=new-pssession -computername xxxxx
import-pssession -session $s
But, when I am trying to run job called EV, using this command:
Start-VBRJob -Job EV
getting error message.
$s=new-pssession -computername xxxxx
import-pssession -session $s
But, when I am trying to run job called EV, using this command:
Start-VBRJob -Job EV
getting error message.
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
Another update:
I need to run locally this script to start existing job called EV
$job=Get-VBRJob | where {$_.Name –eq “EV”}
Start-VBRJob –Job $job
But, I cannot run it remotely.
Basic idea is to trigger this job remotely as a part of a Symantec Enterprise Vault backup.
Anyone has any idea on how to do it?
I need to run locally this script to start existing job called EV
$job=Get-VBRJob | where {$_.Name –eq “EV”}
Start-VBRJob –Job $job
But, I cannot run it remotely.
Basic idea is to trigger this job remotely as a part of a Symantec Enterprise Vault backup.
Anyone has any idea on how to do it?
-
- VP, Product Management
- Posts: 27371
- Liked: 2799 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: Remote PowerShell
Are you able to trigger the same script from a batch file locally on the backup server?
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
Yes,
$job=Get-VBRJob | where {$_.Name –eq “EV”}
Start-VBRJob –Job $job
works fine locally on backup server.
$job=Get-VBRJob | where {$_.Name –eq “EV”}
Start-VBRJob –Job $job
works fine locally on backup server.
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
Should I raise a support call?
-
- Veteran
- Posts: 282
- Liked: 26 times
- Joined: Nov 10, 2010 6:51 pm
- Full Name: Seth Bartlett
- Contact:
Re: Remote PowerShell
I'm guessing that when you are testing the commands locally, you are doing it within the Veeam Power shell console? It sounds like you need to do 1 of 2 things:
1. Run C:\Program Files\Veeam\Backup and Replication\Initialize-VeeamToolkit.ps1 to initialize the Veeam snap-in or
2. Run the command "Add-PSSnapin VeeamPSSnapIn" so you can use the Veeam powershell commands.
1. Run C:\Program Files\Veeam\Backup and Replication\Initialize-VeeamToolkit.ps1 to initialize the Veeam snap-in or
2. Run the command "Add-PSSnapin VeeamPSSnapIn" so you can use the Veeam powershell commands.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
I can use Veeam Powershell commands locally, no problems.Sethbartlett wrote:I'm guessing that when you are testing the commands locally, you are doing it within the Veeam Power shell console? It sounds like you need to do 1 of 2 things:
1. Run C:\Program Files\Veeam\Backup and Replication\Initialize-VeeamToolkit.ps1 to initialize the Veeam snap-in or
2. Run the command "Add-PSSnapin VeeamPSSnapIn" so you can use the Veeam powershell commands.
But, I cannot use it remotely from other computer.
I can create a PS remote session and use native PS commands, but this remote session do not recognise that backup server has VeeamPSSnapin installed.
I will try your commands anyway, thanks.
Re: Remote PowerShell
To use Veeam PowerShell remotely you should perform these steps:
- install WinRM service (Windows Remote Management);
- type this command in PS console:
Should work! Let us know if not.
- install WinRM service (Windows Remote Management);
- type this command in PS console:
Code: Select all
Enable-PSRemoting
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
I have already told several times, that I can connect remotely.Alexey D. wrote:To use Veeam PowerShell remotely you should perform these steps:
- install WinRM service (Windows Remote Management);
- type this command in PS console:
Should work! Let us know if not.Code: Select all
Enable-PSRemoting
Please spend some time reading my posts.
The problem is that during remote session, I cannot run Veeam subset of cmdlets.
-
- Veteran
- Posts: 282
- Liked: 26 times
- Joined: Nov 10, 2010 6:51 pm
- Full Name: Seth Bartlett
- Contact:
Re: Remote PowerShell
After connecting remotely, are you doing the Add-PSSnapin VeeamPSSnapIn command? Does it give you an error stating that it doesn't exist or what? Your connection outside of the Veeam box would not know about the commands without being using the snapin first.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Remote PowerShell
Thanks a lot, that was a missing part.Sethbartlett wrote:After connecting remotely, are you doing the Add-PSSnapin VeeamPSSnapIn command? Does it give you an error stating that it doesn't exist or what? Your connection outside of the Veeam box would not know about the commands without being using the snapin first.
So, the final script to start existing job named EV from remote Powershell:
$s = New-PSSession -Computername server1
Enter-PSSession $s
Add-PSSnapin VeeamPSSnapIn
$job=Get-VBRJob | where {$_.Name –eq “EV”}
Start-VBRJob –Job $job
-
- Enthusiast
- Posts: 58
- Liked: 2 times
- Joined: Nov 30, 2010 1:38 pm
- Full Name: Bernd
- Contact:
Re: Remote PowerShell
I noticed if I run the command manually it works but if I put it into Powershell script it stops after it connects to the remote server. My script looks like this:
So once I execute the script from the command line it just stops at the remote powershell prompt. So basically it seems to stop straight after:
If I execute the command one by hand it starts the remote backup job. The whole idea is that I have this script as part of a post backup command on one VEEAM Server to start the backups on another remote VEEAM Server. Cannot schedule the jobs so basically the last job on the local VEEAM server is going to start the next job on the remote VEEAM server.
I am using VEEAM Backup and Replication v5.0.2.230 (x64) on Windows 2008 R2 Standard Edition (x64) with Powershell 2.0.
Code: Select all
$s = New-PSSession -Computername srvveeam02.internal.com.na
Enter-PSSession $s
Add-PSSnapin VeeamPSSnapIn
Get-VBRJob | where {$_.Name -eq "P1DR"} | Start-VBRJob -RunAsync
Code: Select all
Enter-PSSession $s
I am using VEEAM Backup and Replication v5.0.2.230 (x64) on Windows 2008 R2 Standard Edition (x64) with Powershell 2.0.
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Remote PowerShell
try
or v6
instead of entering the session
[Added]
Don't forget the housekeeping
Code: Select all
Invoke-Command -Session $s -ScriptBlock {
Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Get-VBRJob | where {$_.Name -eq "P1DR"} | Start-VBRJob -RunAsync
}
Code: Select all
Invoke-Command -Session $s -ScriptBlock {
Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Get-VBRJob -Name "P1DR" | Start-VBRJob -RunAsync
}
[Added]
Don't forget the housekeeping
Code: Select all
Get-PSSession | Remove-PSSession
-
- Enthusiast
- Posts: 58
- Liked: 2 times
- Joined: Nov 30, 2010 1:38 pm
- Full Name: Bernd
- Contact:
Re: Remote PowerShell
You are a champion!
Just for anybody want to use this - make sure to add your remote session declaration in front of the code block:
So the whole thing will look like this:
I also assume this is safe to run as a post job command as long as the VEEAM service account has accesss to the powershell script? I will be able to find out only tonight as I cannot kickstart this chain without causing issues with the schedule. In my case I have added "C:\SCRIPTS\RemoteStartP1DR.ps1" to the post activity/command section of a job.
Just for anybody want to use this - make sure to add your remote session declaration in front of the code block:
Code: Select all
$s = New-PSSession -Computername srvveeam02.internal.com.na
Code: Select all
$s = New-PSSession -Computername srvveeam02.internal.com.na
Invoke-Command -Session $s -ScriptBlock {
Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Get-VBRJob | where {$_.Name -eq "P1DR"} | Start-VBRJob -RunAsync
}
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Remote PowerShell
Read this one
Running Powershell Script Post Backup
Running Powershell Script Post Backup
-
- Influencer
- Posts: 22
- Liked: never
- Joined: Jan 27, 2012 12:25 pm
- Full Name: George
- Contact:
Start Job Remotely
[merged]
Hi Guys,
Whats the script to start a backup from a remote server?
I have a Veeam Server (Server A), i would like to start the backup using a script from a different server (Server B).
Thanks!
Hi Guys,
Whats the script to start a backup from a remote server?
I have a Veeam Server (Server A), i would like to start the backup using a script from a different server (Server B).
Thanks!
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Aug 28, 2013 5:52 am
- Contact:
[MERGED] Starting a Backup Job per Script.
Hi at all,
I want to start a Backup Job per Script from another Windows 2008 R2 with no veeam Sulution on it.
After the jobs's done, I need to receive the result of the backup job on the same way.
I want to start a Backup Job per Script from another Windows 2008 R2 with no veeam Sulution on it.
After the jobs's done, I need to receive the result of the backup job on the same way.
-
- Veeam Software
- Posts: 21138
- Liked: 2141 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: Remote PowerShell
Hello, please review this thread for the answers. If you need additional clarification, feel free to ask here. Thanks.
Who is online
Users browsing this forum: No registered users and 23 guests