PowerShell script exchange
1-0-1
Enthusiast
Posts: 54
Liked: never
Joined: Nov 30, 2010 1:38 pm
Full Name: Bernd
Contact:

Re: Remote PowerShell

Post by 1-0-1 » May 03, 2012 11:45 am

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:

Code: Select all

$s = New-PSSession -Computername srvveeam02.internal.com.na
So the whole thing will look like this:

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
}
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.

ThomasMc
Expert
Posts: 293
Liked: 17 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Remote PowerShell

Post by ThomasMc » May 03, 2012 11:58 am 1 person likes this post


George
Influencer
Posts: 22
Liked: never
Joined: Jan 27, 2012 12:25 pm
Full Name: George
Contact:

Start Job Remotely

Post by George » Jun 27, 2012 4:31 pm

[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! :D

svenschulze
Lurker
Posts: 1
Liked: never
Joined: Aug 28, 2013 5:52 am
Contact:

[MERGED] Starting a Backup Job per Script.

Post by svenschulze » Sep 02, 2013 6:55 am

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.

foggy
Veeam Software
Posts: 16936
Liked: 1380 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Remote PowerShell

Post by foggy » Sep 02, 2013 7:17 am

Hello, please review this thread for the answers. If you need additional clarification, feel free to ask here. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests