PowerShell script exchange
Post Reply
LeoKurz
Veeam ProPartner
Posts: 28
Liked: 7 times
Joined: Mar 16, 2011 8:36 am
Full Name: Leonhard Kurz
Contact:

Find Proxies assigned to Repo Affinity

Post by LeoKurz »

Hello,

anyone any idea how to list the proxies of a reposirory paroxy affinity when the Proxy affinity is enabled? I can set it with powershell but how can I read/list them?

Thanx!

__Leo
ThierryF
Expert
Posts: 129
Liked: 34 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Find Proxies assigned to Repo Affinity

Post by ThierryF »

Does this help you ?
HTH

TH


foreach ($job in Get-VBRjob | sort-object -property name) {
$proxies="";
foreach ($proxy in $job.GetProxy()) {
$tmppxname=$proxy.name;
$tmppxtype=$proxy.type;
$proxies="$proxies $tmppxname ($tmppxtype) ++++++";
}
write-host "Job ", $job.name , "`t", "Proxy : ", $proxies, "`n";
}
LeoKurz
Veeam ProPartner
Posts: 28
Liked: 7 times
Joined: Mar 16, 2011 8:36 am
Full Name: Leonhard Kurz
Contact:

Re: Find Proxies assigned to Repo Affinity

Post by LeoKurz »

Hi,

thank you very much for your Input! But the script returns the proxies per Job. I'm lookin for the assigned proxies wehn you enabled Prxy affinity on the reposirory.

__Leo
ThierryF
Expert
Posts: 129
Liked: 34 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Find Proxies assigned to Repo Affinity

Post by ThierryF »

I think I got it : In way of searching proxy based on a repository,
I am searching which repository a proxy has access to :

Code: Select all

foreach ($proxy in Get-VBRViProxy) {
    foreach ($repo in $proxy.GetProxyAffinityInfo().RepositoryAffinityInfos) {
        write-host " Repo Name " , $repo.name, " Autodetect", $repo.AutoDetectAffinityProxies, "Proxy" , $proxy.name ,  "`n";
    }
} 

foreach ($proxy in Get-VBRHvProxy) {
    foreach ($repo in $proxy.GetProxyAffinityInfo().RepositoryAffinityInfos) {
        write-host " Repo Name " , $repo.name, " Autodetect", $repo.AutoDetectAffinityProxies, "Proxy" , $proxy.name ,  "`n";
    }
}
Then Sort on Repository name and I think you got it.

Cheers

TH
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests