PowerShell script exchange
Post Reply
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Job Executing Powershell returns No Data

Post by fkckbrown »

I am having an issue with a job running powershell scripts. The scripts work without an issue as I can run them manually and it will do what I want it to do in Veeam (one is to send me a report of which tapes got used so I can pull them). After I upgraded to V9 build 1715 (latest one out) from the build just before that (suggested by Veeam Support for a different issue), the powershell script can not longer get the data when the job executes it after it finished. I do have the Veeam service account setup as an admin in the Veeam Console (an issues I had previously). Anyone else have this issue or a suggestion of where I could look to try and troubleshoot this?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Job Executing Powershell returns No Data

Post by veremin »

Two most frequent causes are service account lacking required permissions and script returning nothing due to the changes introduced (either in our PS logic or in backup and virtual environment).

Can you post the given script, so that we can take a look and see what troubleshooting steps can be taken?

Thanks,
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Re: Job Executing Powershell returns No Data

Post by fkckbrown »

Everything worked before the last update I did. The last time I had this issue was due to the account it ran it as not having the permissions needed in Veeam (as indicated in my original post). Once the service account was added to Veeam as an Administrator, it worked without an issue. The script does generate the data I need when I run it manually, but if I have a job run it then it is blank (aside from the formatting of the report). Is there a place I can look to confirm what account Veeam will be running the report as?

This script is used to disable my Weekly Tape Backup Job when the Monthly or Yearly Tape Backup Job runs (they are set to run before the Weekly Tape Backup Job). Before anyone starts posting that I could do this with the GFS pool, the issue I have with the GFS pool is the Yearly job. It does not allow me to set when the yearly gets backup as precisely as I want (we do ours on the 3rd Monday in March, the Yearly is locked into January when you use Day of the Week). GFS also does not do parallel processing. So, I have 3 sets of pools for the Weekly, Monthly, and Yearly. The AM and PM thing is because I have two Tape Libraries doing the backups, one is handling my AM jobs and the other handles the PM jobs.

Code: Select all

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer
Connect-VBRServer -server <Server FQDN>
Get-VBRTapeJob -Name "Weekly Full to Tape AM", "Weekly Full to Tape PM" | Disable-VBRJob | out-null
Write-Host -ForegroundColor DarkGreen "Done"
Sensitive information has been replaced with a place holder between < >. In the script, this information is filled out correctly. This script fails, just like the other ones I have that generate a report. The report completes and I can view it, but there is not data in it except the formatting.
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Re: Job Executing Powershell returns No Data

Post by fkckbrown »

As a quick note, I know the code provide doesn't export or generate anything that I can read when ran by the job. It is a job that a job is suppose to execute, but it id not working when it is ran by the job. It will run fine when executed manually by me.
fkckbrown
Enthusiast
Posts: 27
Liked: never
Joined: Jun 20, 2016 1:37 pm
Full Name: Kyle Brown
Contact:

Re: Job Executing Powershell returns No Data

Post by fkckbrown »

So, it looks like the upgrade changed the service run as to local system. What services do I need to have run as the service account to allow it to execute powershell scripts against Veeam when a job starts or stops?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Job Executing Powershell returns No Data

Post by veremin »

I would start with Veeam Backup Service and see whether it's enough. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests