-
- Expert
- Posts: 213
- Liked: 35 times
- Joined: Feb 20, 2012 4:13 pm
- Full Name: Nick Mahlitz
- Contact:
Script After Replication Job Not Running
Before I log a support call am I missing something here?
My last replication job of the night has a setting to run a batch file that invokes a PowerCLI PowerShell script to shut down all our Veeam Proxies.
Double-clicking the batch file on the Veeam Server does indeed shutdown our Veeam Proxies yet when the replication job finished last night I notice this morning all the Veeam Proxies are still up.
Here is my settings:
The script is on the Veeam B&R server. I'm a bit confused as to why this did not work, heck it is a simple thing, run a batch file on the Veeam server that runs a PowerShell script that simply does a Stop-VM for my Veeam Proxies...all works when I double-click the batch file.
The job results show the script ran successfully:
As I say, these scripts reside on the Veeam B&R...the .ps1 script and the .bat file are in the same folder.
EDIT...I thought I could only use batch files but I notice the dropdown on what type of script you can have and there was a PowerShell one so I've selected my PowerShell script direct and see if that runs tonight. So does that mean you cannot reference other files?
My last replication job of the night has a setting to run a batch file that invokes a PowerCLI PowerShell script to shut down all our Veeam Proxies.
Double-clicking the batch file on the Veeam Server does indeed shutdown our Veeam Proxies yet when the replication job finished last night I notice this morning all the Veeam Proxies are still up.
Here is my settings:
The script is on the Veeam B&R server. I'm a bit confused as to why this did not work, heck it is a simple thing, run a batch file on the Veeam server that runs a PowerShell script that simply does a Stop-VM for my Veeam Proxies...all works when I double-click the batch file.
The job results show the script ran successfully:
As I say, these scripts reside on the Veeam B&R...the .ps1 script and the .bat file are in the same folder.
EDIT...I thought I could only use batch files but I notice the dropdown on what type of script you can have and there was a PowerShell one so I've selected my PowerShell script direct and see if that runs tonight. So does that mean you cannot reference other files?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Script After Replication Job Not Running
If you execute the very same script under Veeam service account, will it work as expected or not? Thanks.
-
- Expert
- Posts: 213
- Liked: 35 times
- Joined: Feb 20, 2012 4:13 pm
- Full Name: Nick Mahlitz
- Contact:
Re: Script After Replication Job Not Running
The Veeam Service Account is the same account that I use to RDP to the B&R server and running the script under that is fine..but indeed it must be some sort of permission thing.
I've eliminated the batch file and just execute the PowerShell script after the job so I'll see what happens tonight.
I've eliminated the batch file and just execute the PowerShell script after the job so I'll see what happens tonight.
-
- Veeam Software
- Posts: 21139
- Liked: 2141 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: Script After Replication Job Not Running
Could it be the non-interactive mode the service uses to perform its tasks? While when you're logged in under the same account, you're working in interactive mode.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Script After Replication Job Not Running
Only batch and executables are supported as a pre/post-job activities. The option you're talking about just allows you to limit visible scope to files of particular type.
So, if you want to avoid usage of batch file, try the following construction as a post-job activity:
Thanks.
So, if you want to avoid usage of batch file, try the following construction as a post-job activity:
Code: Select all
Powershell.exe -File "Path to your script"
-
- Expert
- Posts: 213
- Liked: 35 times
- Joined: Feb 20, 2012 4:13 pm
- Full Name: Nick Mahlitz
- Contact:
Re: Script After Replication Job Not Running
Ok...thanks for that...I've set that for tonight.
-
- Expert
- Posts: 213
- Liked: 35 times
- Joined: Feb 20, 2012 4:13 pm
- Full Name: Nick Mahlitz
- Contact:
Re: Script After Replication Job Not Running
This could be the answer as it is still not running.foggy wrote:Could it be the non-interactive mode the service uses to perform its tasks? While when you're logged in under the same account, you're working in interactive mode.
I see in the logs:
Log has been started by 'SPP-VEEAM\localesxadmin' user (Non-interactive)
If that is the case then the script will not run under that...it runs fine logged in to my Veeam B&R Server as 'SPP-VEEAM\localesxadmin' but that will be in interactive mode.
I'll see if I can reference to run the script under different credentials.
-
- Expert
- Posts: 213
- Liked: 35 times
- Joined: Feb 20, 2012 4:13 pm
- Full Name: Nick Mahlitz
- Contact:
Re: Script After Replication Job Not Running
Changing the credentials used by referencing a RUNAS has done the trick...
Who is online
Users browsing this forum: Amazon [Bot] and 16 guests