Comprehensive data protection for all workloads
Post Reply
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Veeam 9 Pre and Post Scripts Issue

Post by fkckbrown »

As a work around to issues for tape backup, and some issues with the GFS Tape Backup, I have setup jobs for the tape backups to do our Weekly, Monthly, and Yearly. When we run the Monthly or Yearly, we do not run the Weekly. To do this, I created some Powershell scripts that will disable the Weekly Job and have them staggered in the start time (Weekly is last to start). According to the job history the script ran without an issue (I am using a bat file to execute the powershell), but job did not disable. I tested it manually and the batch file executed the powershell and the Weekly Jobs were disabled. Currently, I do not have anything piping to a file. Any thoughts on what could be the issue?

Below are the scripts for the disable and enable, including batch file (<FQDN> is a place holder for the Fully Qualified Domain Name, which is in the script).

Disable:

Code: Select all

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer
Connect-VBRServer -server <FQDN>
Get-VBRTapeJob -Name "Weekly Full to Tape AM", "Weekly Full to Tape PM" | Disable-VBRJob | out-null
Write-Host -ForegroundColor DarkGreen "Done"
Enable:

Code: Select all

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer
Connect-VBRServer -server <FQDN>
Get-VBRTapeJob -Name "Weekly Full to Tape AM", "Weekly Full to Tape PM" | Enable-VBRJob | out-null
Write-Host -ForegroundColor DarkGreen "Done"
Batch Enable:

Code: Select all

@ECHO OFF
Powershell.exe -ExecutionPolicy ByPass -File C:\VeeamScripts\WeeklyEnable.ps1
EXIT
Batch Disable:

Code: Select all

@ECHO OFF
Powershell.exe -ExecutionPolicy ByPass -File C:\VeeamScripts\WeeklyDisable.ps1
EXIT
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 9 Pre and Post Scripts Issue

Post by veremin »

What account did you use during manual tests? Was it a veeam service account or a different one? Thanks.
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Re: Veeam 9 Pre and Post Scripts Issue

Post by fkckbrown »

It was a different one. Does the service account have to have admin access to Veeam (it already has admin access to the server)?
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 9 Pre and Post Scripts Issue

Post by veremin »

Correct, the account under which you're planning to execute VB&R scripts should have admin rights on backup server. Thanks.
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Re: Veeam 9 Pre and Post Scripts Issue

Post by fkckbrown »

Will backup operator work instead of being a full admin? I believe a backup operator has the ability to disable/enable jobs, I am just not sure if they would have the access through powershell.
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 9 Pre and Post Scripts Issue

Post by veremin »

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Semrush [Bot] and 139 guests