PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Get latest veeam version

Post by matteu »

Hello,

Is there a way to query Veeam website to know what is the latest build version for VBR ?
I would like to monitor if the build installed is the latest one and without need to keep up to date a build version (if possible).

Thanks
Gostev
Chief Product Officer
Posts: 31561
Liked: 6725 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Get latest veeam version

Post by Gostev » 1 person likes this post

Hello, what about monitoring this Support KB at https://www.veeam.com/kb2680
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get latest veeam version

Post by david.domask » 3 people like this post

I was going to recommend the same thing as Anton -- just curl/Invoke-Webrequest that page and parse out the versions.

I punched out two fast/lazy functions for pulling from the VBR Server installed version and the most recent version on the KB article Anton linked:

Code: Select all

function Get-VBRServerVersion {
	$InstallPath = Get-ItemProperty -Path "HKLM:\Software\Veeam\Veeam Backup and Replication\" | Select -ExpandProperty CorePath
	Add-Type -LiteralPath "$InstallPath\Veeam.Backup.Configuration.dll" 
	$ProductData = [Veeam.Backup.Configuration.BackupProduct]::Create()
	$Version = $ProductData.ProductVersion.ToString()
	if ($ProductData.MarketName -ne "") {$Version += " $($ProductData.MarketName)"}
	return $Version
}

<# note: function will temporarily write the data to a file report_temp.html as the piping of Invoke-Webrequest content is annoying. 
The file is cleaned up later, but you will need to define $tempdir at some point in your scripts; 
without this, it will try to make the file where the script is executed; 
I recommend set a parameter for the script like -ReportTempDir as optional parameter, 
then check if it's NULL at start of script; if it is, check/make C:\tmp and define $tempdir as C:\tmp #>

function Get-VBRVersionListWeb {
	$webrequest = New-Object System.Net.WebClient
	$webrequest.DownloadString("https://www.veeam.com/kb2680") | Out-File $tempdir\report_temp.html
	$content = Get-Content $tempdir\report_temp.html
	$VBRMostRecentVer = $content |select-string -Pattern "(?:[0-9]{1,3}\.){3}[0-9]{1,4}" | Select-String -Pattern "\<td" | Select -First 1
	Remove-Item -LiteralPath "$($tempdir)\report_temp.html"
	$MostRecentVerCln = $VBRMostRecentVer.ToString() -replace '<td>|</td>',''
	$MostRecentVerCln = $MostRecentVerCln.Trim()
	return $MostRecentVerCln
}
This is run on VBR server ideally (you will need to likely edit the Get-VBRServerVersion paths to work with remote console), and it should return the current VBR install version and also the most recent version from the list on the KB page.

Image
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get latest veeam version

Post by matteu » 1 person likes this post

Perfect :). Just tested now and works ^^
Thank you both for your answer !
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get latest veeam version

Post by oleg.feoktistov » 2 people like this post

By the way, in the upcoming version we introduce an official cmdlet to get backup server info (name, build and patches), so soon no registry queries for current server installation like in Get-VBRServerVersion function above will be needed. Thanks!
albertwt
Veteran
Posts: 880
Liked: 47 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: Get latest veeam version

Post by albertwt »

Thank you @oleg.feoktistov,
Does the new cmdlet for the next v12.1 will be under the https://helpcenter.veeam.com/docs/backu ... parameters as an additional attribute?

Or a separate cmdlet entry?
--
/* Veeam software enthusiast user & supporter ! */
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get latest veeam version

Post by oleg.feoktistov » 1 person likes this post

As a separate cmdlet. It wouldn't make much sense to display these properties with Get-VBRServer as they are relevant to backup server only. So for other servers added to your backup infrastructure they would always be empty. Thanks!
albertwt
Veteran
Posts: 880
Liked: 47 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: Get latest veeam version

Post by albertwt »

That's great, many thanks @Oleg for your confirmation and explanation.
--
/* Veeam software enthusiast user & supporter ! */
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get latest veeam version

Post by matteu »

Hello,

When does the new cmdlet will be available ?
Gostev
Chief Product Officer
Posts: 31561
Liked: 6725 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Get latest veeam version

Post by Gostev »

Hi, it's mentioned in the What's New document for 12.1
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get latest veeam version

Post by matteu »

I'm sorry but if you're talking about this : https://www.veeam.com/veeam_backup_12_1 ... new_wn.pdf
I don't find it ... I just find Enterprise manager will display exact build of VBR but it's not what I'm asking ^^

and on the powershell changelog documentation, I don't find the cmdlet...
Gostev
Chief Product Officer
Posts: 31561
Liked: 6725 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Get latest veeam version

Post by Gostev »

Yes, this document. It's the very last bullet of the PowerShell SDK section.
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get latest veeam version

Post by matteu » 2 people like this post

Thanks, for other people, the cmdlet is :
(Get-VBRBackupServerInfo).build.tostring()
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests