PowerShell script exchange
Post Reply
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Get-VBRJobProxy

Post by marius roma »

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
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRJobProxy

Post by veremin » 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests