PowerShell script exchange
Post Reply
grayknighty
Lurker
Posts: 2
Liked: 1 time
Joined: Nov 21, 2022 2:59 pm
Contact:

SolarWinds Powershell Monitor to Veeam B&R

Post by grayknighty » 1 person likes this post

Hi Veeam,

We are monitoring Veeam B&R via SolarWinds SAM module and are using a PowerShell Monitor to try and monitor failed jobs.

I'm currently using the Veeam 9.5 template from Thwack (https://thwack.solarwinds.com/product-f ... 585#290585)

In here is a "Failed Jobs" Powershell command, that after following KB (https://support.solarwinds.com/SuccessC ... uage=en_US) to get working with Veeam 11. We are just getting the following message:

Output: ==============================================
Message: ERROR executing "Get-VBRJob": Access is denied
Message: No failed backup or replication jobs found.
Statistic: 0

Veeam PS snap-in is installed and loaded to use on the VBR server on the "Credential for Monitoring" account. I'm using Execution = Remote Host so the commands run on the VBR server not from SolarWinds server and still getting access denied (that account is also full admin on Veeam).

If I run the script locally it works fine, does anyone know why we are getting Access denied when SolarWinds SAM is trying to run the command that works locally.

Many thanks

Graham
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: SolarWinds Powershell Monitor to Veeam B&R

Post by HannesK »

Hello,
and welcome to the forums. I never used Solarwinds, but maybe we can narrow it down. :-)
Veeam PS snap-in is installed and loaded to use on the VBR server on the "Credential for Monitoring" account.
can you maybe explain a bit more, what that means? Because "Starting from Veeam Backup & Replication 11, the Veeam PowerShell Toolkit is a PowerShell module instead of a snap-in." (from the KB article). Where did you install what exactly?

I'm using Execution = Remote Host
could you maybe past the full script? because powershell execution on a remote host can be done with "invoke-command" or "Enter-PSSession"

If the command runs on the SolarWind server, then one needs to authenticate first with Connect-VBRServer

Best regards,
Hannes
grayknighty
Lurker
Posts: 2
Liked: 1 time
Joined: Nov 21, 2022 2:59 pm
Contact:

Re: SolarWinds Powershell Monitor to Veeam B&R

Post by grayknighty »

Hi Hannes, many thanks for your response.

Sorry I used the wrong terminology, we are using Veeam B&R 11 and the powershell *module* is installed on the B&R server.

In SolarWinds you have the choice or "local host" or "remote host" execution. Local host will run the script on the SolarWinds server while remote hosts connects over WinRM to the target server (in this case the B&R server) and runs the command there. Local host, won't work as the module isn't installed on the SolarWinds server so I'm trying remote host. Normal PowerShell scripts work like get-process but not Veeam specific commands like get-vbrjob (returns Access Denied)

As a simple test this is the script I'm working with
$vbrjob = (Get-vbrjob)[0];
$info = [String]::Format("Name: {0}; Type: {1}", $vbrjob.Name, $vbrjob.JobType);

Write-Host "Statistic.Name: $($vbrjob.Name)";
Write-Host "Message.Name: Name - $($info)";

Exit(0);


This should a message saying backup job name and backup type. It works perfectly if I RDP to the B&R server and run the command in powershell manually but doesn't work through SolarWinds WinRM connection.

Any help would be amazing. Thanks
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: SolarWinds Powershell Monitor to Veeam B&R

Post by HannesK »

Hello,
okay, makes sense. I guess a wrong user name then. Because the error message says "access denied".

Best regards,
Hannes
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 17 guests