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
}