I have seen dead forum posts in the past asking how to mass update Veeam with command line. As we maintain hundreds of veeam instances, doing the upgrade manually was not an option. Below is the solution we have created. Please chime in if anything here could be improved. One note in the code examples I provided. We utilize Kaseya to manage our devices, and its scripting engine has limitations. Particularly in that powershell, to be reliably used must be invoked through command line, and it heavily encourages massive gross one line commands. I apologize for some of the code spaghetti coming.
First problem: As documented here ( https://helpcenter.veeam.com/docs/backu ... l?ver=95u4 ), upgrading via command line is not an option. It must be uninstalled, and then installed. Not cool, but manageable.
Second problem: The documentation on how to install Veeam in unattended mode is functionally 100% incorrect. ( https://helpcenter.veeam.com/docs/backu ... l?ver=95u4 )
From having undocumented required MSI flags, to not mentioning huge pieces of what is needed, it took a lot of time to get a solution working.
Now let's jump into it!
1 - For our solution, Kaseya's native unpack functionality does not play nice with ISO's, so we extracted the ISO and repackaged it as a zip on dropbox. The first portion of the script creates a working directory and places both the zip and our licence file in said directory. The zip is then unpacked. As that code has our own links in it, I will not provide it.
2 - Backup the config of veeam in case it breaks.
Code: Select all
powershell.exe -nologo -executionpolicy bypass -noprofile -command "Add-PSSnapin VeeamPSSnapin; Start-VBRConfigurationBackupJob"
Code: Select all
powershell.exe -nologo -executionpolicy bypass -noprofile -command "Add-PSSnapin VeeamPSSnapin; Get-VBRJob | ?{$_.GetLastState() -eq 'Working'} | Stop-VBRJob"
Code: Select all
Taskkill /IM veeam.backup.shell.exe /F
Code: Select all
powershell.exe -nologo -executionpolicy bypass -noprofile -command "Get-Service Veeam* | Stop-Service -Force"
Code: Select all
powershell -command "$product = \"Veeam*\";$UninstallKeys = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall');$uninstallKeys = foreach ($key in (Get-ChildItem $UninstallKeys) ) {if ($key.GetValue(\"DisplayName\") -like \"$product\") {[pscustomobject]@{UninstallString = $key.GetValue(\"UninstallString\");}}};foreach ($key in $uninstallkeys) {$uninstallString = $key.UninstallString;if ($uninstallString.StartsWith('MsiExec.exe')) {$uninstallString = $uninstallString.replace('/I','/X') + ' /qb- /quiet /passive /norestart'} else {$uninstallString = ' '}& cmd /c $uninstallString}"
Code: Select all
start /wait C:\temp\veeam9.5u4\Redistr\x64\SqlExpress\2016SP1\SQLEXPR_x64_ENU.exe /Q /ACTION=Install /FEATURES=SQL /INSTANCENAME=VEEAMSQL2016 /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /SQLSYSADMINACCOUNTS="Builtin\Administrators" /AGTSVCACCOUNT="NT AUTHORITY\SYSTEM" /IACCEPTSQLSERVERLICENSETERMS
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs01Catalog.txt" /qn /i "C:\temp\veeam9.5u4\Catalog\VeeamBackupCatalog64.msi" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs02Server.txt" /qn /i "C:\temp\veeam9.5u4\Backup\Server.x64.msi" ACCEPTEULA="YES" ACCEPT_THIRDPARTY_LICENSES="1" VBR_LICENSE_FILE="C:\Temp\YOURLICENCEHERE.lic" VBR_AUTO_UPGRADE="YES"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs03Shell.txt" /qn /i "C:\temp\veeam9.5u4\Backup\Shell.x64.msi" ACCEPTEULA="YES" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs04AD.txt" /qn /i "C:\temp\veeam9.5u4\Explorers\VeeamExplorerForActiveDirectory.msi" ACCEPT_EULA="1" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs05Exchange.txt" /qn /i "C:\temp\veeam9.5u4\Explorers\VeeamExplorerForExchange.msi" ACCEPT_EULA="1" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs06Oracle.txt" /qn /i "C:\temp\veeam9.5u4\Explorers\VeeamExplorerForOracle.msi" ACCEPT_EULA="1" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs07Sharepoint.txt" /qn /i "C:\temp\veeam9.5u4\Explorers\VeeamExplorerForSharePoint.msi" ACCEPT_EULA="1" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs08SQL.txt" /qn /i "C:\temp\veeam9.5u4\Explorers\VeeamExplorerForSQL.msi" ACCEPT_EULA="1" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs09LinuxRedist.txt" /qn /i "C:\temp\veeam9.5u4\Packages\VALRedist.msi" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
start /wait msiexec.exe /L*v "C:\temp\InstallLogs10WindowsRedist.txt" /qn /i "C:\temp\veeam9.5u4\Packages\VAWRedist.msi" ACCEPT_THIRDPARTY_LICENSES="1"
Code: Select all
powershell -command "get-service -displayname *veeam* | foreach-object { Start-Service -InputObj $_.Name }"
Code: Select all
powershell.exe -nologo -executionpolicy bypass -noprofile -command "Add-PSSnapin VeeamPSSnapin; Rescan-VBREntity -AllHosts -AllCloudProviders -AllRepositories -AllReplicas -Wait"
I will probably be tweaking this over the coming days, but the big takeaway is that this is possible. The documentation Veeam provides is inaccurate to the point of being misleading, and the lack of a single flag in place upgrade option is highly disappointing. For an enterprise product, seems like quite the oversight! Also, having both undocumented and non uniform MSI flags was quite the challenge.
Have fun!