PowerShell script exchange
Post Reply
WorkingHardInIt
Veeam Vanguard
Posts: 39
Liked: 11 times
Joined: Feb 14, 2014 1:27 pm
Full Name: Didier Van Hoye
Contact:

Get-VBRNASProxyServer does not return the Name of the File Proxy?

Post by WorkingHardInIt »

Hi there,
I was automating a bit for File Proxies today and I noticed that VBR v10 PowerShell has the Get-VBRNASProxyServer and Set-VBRNASProxyServer commands to work with. However, is not reporting the name of the proxies which is annoying.

Get-VBRNASProxyServer | fl *
Id : dde472e1-d0d3-44cd-b007-329689458da8
Description : Created by VBR\vbrveeam at 8/19/2020 2:15 AM.
Server : Veeam.Backup.Core.Common.CHost
ConcurrentTaskNumber : 4
Id : 50cbf622-129e-482a-9197-d67e5bb1fb1f
Description : Created by Veeam Backup & Replication
Server : Veeam.Backup.Core.Common.CHost
ConcurrentTaskNumber : 4

It is also slower but I guess that is because it provides more checks and protection than calling the .NET object directly and using options. So to able to grab the name for logging etc I resorted to calling the .NET.
Maybe I am missing something and there is a way to get the Name of the File Proxy Get-VBRNASProxyServer?

Many thanks,
Didier

(all script snippets below)

Code: Select all

$MaxTaskCountValueToSet = 6
$FileProxies = Get-VBRNASProxyServer
foreach ($FileProxy in $FileProxies) {
    $FileProxyName = $FileProxy.ID
    $MaxTaskCount = $FileProxy.ConcurrentTaskNumber
    Write-Host "The file proxy $FileProxyName has a concurrent task limit of $MaxTaskCount" -ForegroundColor Yellow
    Set-VBRNASProxyServer -ProxyServer $FileProxy -ConcurrentTaskNumber $MaxTaskCountValueToSet
}

#Report the changes
$FileProxies = Get-VBRNASProxyServer
foreach ($FileProxy in $FileProxies) {
    $FileProxyName = $FileProxy.ID
    $MaxTaskCount = $FileProxy.ConcurrentTaskNumber
    Write-Host "The file proxy $FileProxyName has a concurrent task limit of $MaxTaskCount" -ForegroundColor Green
}


#We grab the file proxies. Note this code does not grab
#any other type of proxies. We set the MaxTasksCount and report back
$MaxTaskCountValueToSet = 12
$FileProxies = [Veeam.Backup.Core.CFileProxy]::GetAll()
Foreach ($FileProxy in $FileProxies) {
$FileProxyName = $FileProxy.Name
$MaxTaskCount = $FileProxy.MaxTasksCount
Write-Host "The file proxy $FileProxyName has a concurrent task limit of $MaxTaskCount" -ForegroundColor Yellow
$options = $FileProxy.Options
$options.MaxTasksCount = $MaxTaskCountValueToSet
$FileProxy.SetOptions($options)
}

#Report the changes
$FileProxies = [Veeam.Backup.Core.CFileProxy]::GetAll()
Foreach ($FileProxy in $FileProxies) {
$FileProxyName = $FileProxy.Name
$MaxTaskCount = $FileProxy.MaxTaskCount
Write-Host "The file proxy $FileProxyName has a concurrent task limit of $MaxTaskCount" -ForegroundColor Green
}
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Get-VBRNASProxyServer does not return the Name of the File Proxy?

Post by jhoughes » 1 person likes this post

You can actually get the proxy name from the 'Server' property, as this gives back the [Veeam.Backup.Core.Common.CHost] object.

Code: Select all

$NasProxy = Get-VBRNASProxyServer

$NasProxy.Server

Info               : This server (Microsoft Windows Server)
ParentId           : 00000000-0000-0000-0000-000000000000
Id                 : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
Name               : ATLOSECENTRAL.usdemo.veeam.local
Reference          :
Description        : Backup server
IsUnavailable      : False
Type               : Local
ApiVersion         : Unknown
PhysHostId         : d7c4ff97-b99b-4d1f-884d-283b7b6b9ee3
ProxyServicesCreds :
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
WorkingHardInIt
Veeam Vanguard
Posts: 39
Liked: 11 times
Joined: Feb 14, 2014 1:27 pm
Full Name: Didier Van Hoye
Contact:

Re: Get-VBRNASProxyServer does not return the Name of the File Proxy?

Post by WorkingHardInIt »

Cool, thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests