PowerShell script exchange
Post Reply
jellekamma
Influencer
Posts: 13
Liked: never
Joined: Jan 07, 2019 11:22 am
Full Name: Jelle Kamma
Contact:

Script after job failed with error

Post by jellekamma »

Hi guys,

I am trying to run a powershell script after my replication job completes. The script gives the replicated vm's a new tag.
The script runs fine when I open the PS1 manually. However B&R gives me this error: 6/30/2020 10:00:57 AM :: Post-job script terminated with exit code 1

The script is located and ran from the backupserver itself

here is the script:

Code: Select all

set-executionpolicy -executionpolicy unrestricted
connect-viserver -server "MYSERVERNAME" -User MYACCOUNT -Password MYPASSWORD
Get-VM -Name *_replica_XX* | New-TagAssignment -Tag "Replica XX"
Please help!
jellekamma
Influencer
Posts: 13
Liked: never
Joined: Jan 07, 2019 11:22 am
Full Name: Jelle Kamma
Contact:

Re: Script after job failed with error

Post by jellekamma »

Fixed my own issue, I happend to have installed powercli for the current user. When installing them for all users, the issue was resolved and the script worked fine.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Script after job failed with error

Post by oleg.feoktistov »

That wasn't my initial guess, but glad you could find the root cause!
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests