Get-VBRJobProxy

PowerShell script exchange

Get-VBRJobProxy

Veeam Logoby marius roma » Fri Jun 24, 2016 3:30 pm

I am using a script to list all the proxyies used by all my backup jobs.
The code looks like:
Code: Select all
Asnp VeeamPSSnapin
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
    {
    $Job.Name
    foreach ($prox in ($job | get-vbrjobproxy)) {
    $prox.name
     }
    }

If a job is set to use one or more proxyies I see the name of the job and the list of the proxyies.
If the job is confnggured for automatic selection I get an orange message that sounds like "WARNING: Automatic selection is enabled." and the list af all the available proxyies.
How can I remove the orange message or, even better, intercept it and manage inside an (if automatic selection is enabled, then ...)?
Regards
marius
marius roma
Expert
 
Posts: 317
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Get-VBRJobProxy

Veeam Logoby v.Eremin » Mon Jun 27, 2016 5:27 am 1 person likes this post

You can use the following script in order to list only jobs for which proxy automatic selection is disabled. Proxy names are listed as well:

Code: Select all
asnp VeeamPSSnapin
$Report = @()
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup" -and $_.info.Options.RootNode.SourceProxyAutoDetect -eq $False}))
{
$ProxyInfo = New-Object psobject
$ProxyInfo | Add-Member -MemberType NoteProperty -Name "JobName" -Value $Job.Name
$ProxyInfo | Add-Member -MemberType NoteProperty -Name "AutoDetect" -Value $Job.info.Options.RootNode.SourceProxyAutoDetect
$ProxyInfo | Add-Member -MemberType NoteProperty -Name "ProxyName" -Value (Get-VBRJobProxy -Job $Job).name
$Report += $ProxyInfo
}
$Report


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests