PowerShell script exchange
Post Reply
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Experts,

Case # 04824481

We are from Philips R&D team, We are doing automation of veeam 10 installation through powershell.

Scenario: Uninstalling existing veeam 9.5 update 4 and need to install Veeam 10 through powershell.

Detailed Description:

During the installation of Veeam 10 through PowerShell, I am getting 3 popups. 2 Pop ups related to Database. If we have to use the existing database then we need to press "YES" button to further, Another one is related to veeam virtual lab since its already configured. We have to enter manually ''OK" then only its allow us to install. I am not able to pass any parameter to automate it. Because not sure exactly which place I need to pass the parameter. Expert's I need your help to passing parameter and fix this issue. It block our automation. We are struck and not able to proceed further to complete our automation. Kindly help us to fix this issue. I have attached the script below. You can have a look, It helps to fix the issue soon. I am looking forward to hear from you.

Thanks in Advance.

Regards
Leo


Our Powershell Script for installing veeam 10:

Code: Select all

Function InstallVeeam
{

	param([string]$ProxyApplianceName = $args[0],[string]$VirtualLabName1 = $args[1],[string]$VirtualLab = $args[2],[string]$ESXiIPVL = $args[3])
	
	#[string]$ProxyServer = $args[0]
	
	#[string]$vCenterIp = $args[5],[string]$vCenterAdminAccount = $args[6],[string]$vCenterAdminPassword = $args[7]
	
	Log "Starting the VEEAM Backup and Replication Installation.."
	
	
	$VEEAMINSTALLER = "$BasePath\VeeamInstall"
	$getlicfile = Get-ChildItem C:\Temp\VeeamInstall | Where-Object {$_.Name -match ".lic"}
	$licfilename = $getlicfile.Name
	$licfilepath = "C:\Temp\VeeamInstall\$licfilename"
	
	
	#Mapping the disks 
	Get-Disk | where PartitionStyle -EQ 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -DriveLetter 'D' -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "DISK2" -Confirm:$false			
	

	# Install SQLSysClrTypes
	Log "Validating if SQLSysClrTypes is already installed"
	$SQLSysClrTypesInstallStatus = Get-WmiObject Win32_Product | Where {$_.Name -match 'System CLR Types for SQL'}
	if ($SQLSysClrTypesInstallStatus)
	{
		Log "SQLSysClrTypes is already installed"
	}
	else
	{
		try
		{
			Log  "Installing SQLSysClrTypes.msi"
			$InstallCommandArguments = @"
/quiet /i "$VEEAMINSTALLER\Redistr\x64\SQLSysClrTypes.msi" /l*v "$VEEAMINSTALLER\SQLSysClrTypes.log"
"@
			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	# Install SQL Shared Management Objects
	Log "Validating if SharedManagementObjects is already installed"
	$SharedManagementObjectsInstallStatus = Get-WmiObject Win32_Product | Where {$_.Name -match 'SQL Server 2014 Management Objects'}
	if ($SharedManagementObjectsInstallStatus)
	{
		Log "SharedManagementObjects is already installed"
	}
	else
	{
		try
		{
			Log  "Installing SharedManagementObjects.msi"
			$InstallCommandArguments = @"
/quiet /i "$VEEAMINSTALLER\Redistr\x64\SharedManagementObjects.msi" /l*v "$VEEAMINSTALLER\SharedManagementObjects.log"
"@
			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	# Install SQL Express
	Log "Validating if SQL2012EXP is already installed"
	$SQL2012EXPInstallStatus = Get-WmiObject Win32_Product | Where {$_.Name -match 'SQL Server 2012'}
	if ($SQL2012EXPInstallStatus)
	{
		Log "SQL2012EXP is already installed"
	}
	else
	{
		try
		{
			Log "Installing SQL" 
			ExecuteProcess -fullexepath "$VEEAMINSTALLER\Redistr\x64\SQLEXPR_x64_ENU.exe" -arglist "/qs /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /IACCEPTSQLSERVERLICENSETERMS"
			ExecuteProcess -fullexepath "$VEEAMINSTALLER\Redistr\x64\SQLEXPR_x64_ENU.exe" -arglist "/qs /ACTION=PrepareImage /FEATURES=SQL,RS /INSTANCEID=VEEAMSQL2012 /IACCEPTSQLSERVERLICENSETERMS"
			ExecuteProcess -fullexepath "$VEEAMINSTALLER\Redistr\x64\SQLEXPR_x64_ENU.exe" -arglist "/qs /ACTION=CompleteImage /INSTANCENAME=VEEAM /INSTANCEID=VEEAM2012 /SQLSYSADMINACCOUNTS=$user /AGTSVCACCOUNT='NT AUTHORITY\SYSTEM' /IACCEPTSQLSERVERLICENSETERMS"
	
			# Setting SQL Services to Automatic
			Log "Starting SQL Services"
			Get-Service -Name SQL*,MSSQL* | Set-Service -StartupType Automatic
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	# Copying and Importing the SQL Powershell module 
	Log "Validating if SQL files are already Copied"
	$Program_Files1 = "C:\Program Files\WindowsPowerShell\Modules"
	$Program_Files2 = "C:\Program Files (x86)\WindowsPowerShell\Modules"
	$SQLfile1 = test-path "$Program_Files1\SQLServer"
	$SQLfile2 = test-path "$Program_Files2\SQLServer"
	if($SQLfile1 -and $SQLfile2)
		{
			Log "SQL files are already copied"
		}
	else
		{
			Copy-Item "$VEEAMINSTALLER\SQLServer" "C:\Program Files\WindowsPowerShell\Modules" -Recurse
			Copy-Item "$VEEAMINSTALLER\SQLServer" "C:\Program Files (x86)\WindowsPowerShell\Modules" -Recurse
		}
	
	Import-Module "C:\Program Files\WindowsPowerShell\Modules\SQLServer\SqlServer.psd1"
	
	
	
	# Set sysadmin previleage to System account
	Invoke-Sqlcmd -ServerInstance "$ENV:COMPUTERNAME\VEEAM" -Query "exec sp_addsrvrolemember 'NT AUTHORITY\SYSTEM','sysadmin'"
	
	# Installing the Backup Catalog
	Log  "Installing Backup Catalog"
	$BackupCatalogStatus = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Backup Catalog'}
	if ($BackupCatalogStatus)
	{
		Log "Backup Catalog is already installed"
	}
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Catalog\VeeamBackupCatalog64.msi" ACCEPT_THIRDPARTY_LICENSES="1" VBRC_SERVICE_USER=$user VBRC_SERVICE_PASSWORD=$password VBRC_SERVICE_PORT=9391  /l*v "$VEEAMINSTALLER\VeeamBackupCatalog64.log
"@
			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
	    }
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}	
	}
	
	# Installing Backup and Replication Server
	Log  "Installing Backup and Replication Server"
	$BackupReplicationStatus = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Backup & Replication Server'}
	if ($BackupReplicationStatus)
	{
		Log "Backup and Replication server is already installed"
	}
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Backup\Server.x64.msi" ACCEPTEULA="yes" ACCEPT_THIRDPARTY_LICENSES="1" VBR_LICENSE_FILE=$licfilepath VBR_SERVICE_USER=$user VBR_SERVICE_PASSWORD=$password VBR_SQLSERVER_SERVER=$env:COMPUTERNAME\VEEAM VBR_SQLSERVER_DATABASE=VeeamBackup VBR_SQLSERVER_AUTHENTICATION=0 VBR_SQLSERVER_USERNAME=$user VBR_SQLSERVER_PASSWORD=$password  /l*v "$VEEAMINSTALLER\Server.x64.log
"@
			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	# Installing Veeam Console
	Log  "Installing Console"
	$Veeamconsole = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Backup & Replication Console'}
	if ($Veeamconsole)
	{
		Log "Veeam console is already installed"
	}
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Backup\Shell.x64.msi" ACCEPTEULA="yes" ACCEPT_THIRDPARTY_LICENSES="1"  /l*v "$VEEAMINSTALLER\Shell.x64.log
"@
			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	# Installing Veeam Explorer For ActiveDirectory
	Log  "Installing Veeam Explorer For ActiveDirectory"
	$VeeamExplorerAD = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Explorer for Microsoft Active Directory'}
	if ($VeeamExplorerAD)
	{
		Log "Veeam Explorer For ActiveDirectory is already installed"
	}
	else
	{
		try
		{
	$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Explorers\VeeamExplorerForActiveDirectory.msi" ACCEPT_EULA=1 ACCEPT_THIRDPARTY_LICENSES=1 /l*v "$VEEAMINSTALLER\VeeamExplorerForActiveDirectory.log
"@
	Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	
	# Installing Veeam Explorer For Exchange
	Log "Installing Veeam Explorer For Exchange"
	$VeeamExplorerEX = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Explorer for Microsoft Exchange'}
	if ($VeeamExplorerEX)
	{
		Log "Veeam Explorer For Exchange is already installed"
	}	
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Explorers\VeeamExplorerForExchange.msi" ACCEPT_EULA=1 ACCEPT_THIRDPARTY_LICENSES=1 ADDLOCAL=PS_EXCHANGEEXPLORER /l*v "$VEEAMINSTALLER\VeeamExplorerForExchange.log
"@ 

			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
	    }
		
	    catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}
	
	# Installing Veeam Explorer For Oracle
	Log "Installing Veeam Explorer For Oracle"
	$VeeamExplorerOR = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Explorer for Oracle'}
	if ($VeeamExplorerOR)
	{
		Log "Veeam Explorer For Oracle is already installed"
	}	
	else
	{
		try
		{
	
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Explorers\VeeamExplorerForOracle.msi" ACCEPT_EULA=1 ACCEPT_THIRDPARTY_LICENSES=1 /l*v "$VEEAMINSTALLER\VeeamExplorerFororacle.log
"@

			start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}	
	
	# Installing Veeam Explorer For SharePoint
	Log "Installing Veeam Explorer For SharePoint"
	$VeeamExplorersp = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Explorer for Microsoft SharePoint'}
	if ($VeeamExplorersp)
	{
		Log "Veeam Explorer For SharePoint is already installed"
	}	
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Explorers\VeeamExplorerForSharePoint.msi" ACCEPT_EULA=1 ACCEPT_THIRDPARTY_LICENSES=1 /l*v "$VEEAMINSTALLER\VeeamExplorerForsharepoint.log
"@

			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}	
		
	
	# Installing  Veeam Explorer For SQL
	Log "Installing Veeam Explorer For SQL"
	$VeeamExplorersql = Get-WmiObject Win32_Product | Where {$_.Name -match 'Veeam Explorer for Microsoft SQL Server'}
	if ($VeeamExplorersql)
	{
		Log "Veeam Explorer For SQL is already installed"
	}	
	else
	{
		try
		{
			$InstallCommandArguments = @"
/passive /i "$VEEAMINSTALLER\Explorers\VeeamExplorerForSQL.msi" ACCEPT_EULA=1 ACCEPT_THIRDPARTY_LICENSES=1 /l*v "$VEEAMINSTALLER\VeeamExplorerForSQL.log
"@

			Start-Process msiexec -ArgumentList $InstallCommandArguments -Wait
		}
		catch
		{
			Log "Install Failed"
			Throw "Install Failed"
		}
	}

}
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Help with Veeam 10 unattended installation

Post by tsightler » 2 people like this post

You should probably review the V10 upgrade script here:

https://github.com/VeeamHub/powershell/ ... UpgradeV10
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Help with Veeam 10 unattended installation

Post by oleg.feoktistov » 1 person likes this post

Hi Leo,

I split your post from the original topic as it was related solely to the powershell module migration and installation.

Agree with Tom, VeeamHub abounds with treasures in general. There is even the script for unattended upgrade from VBR v9.5b to v10.

As for the function you posted, at first glance, your issue might be related to the fact that VBR Server installation part (Server.x64.msi) is missing /qn parameter, which prevents user interaction.

Thanks,
Oleg
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Oleg,

Thanks much. I will try and let you know.

W.r.t unattended upgrade for me its not working. I have used that same veeam upgrade script from the mentioned link (powershell-f26/automated-upgrade-from-9 ... 65286.html). I have already replied you can see. Developer of the script ask me raise a case with veeam support.

Already raised a case with Veeam but no luck. So that's why I am manually taking veeam configuration back, then Uninstalling veeam 9.5, then Installing veeam 10 through powershell script and restoring the configuration backup.

Regards
leo.
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Oleg,

In the script I have added /qn parameter in Server.x64.msi line to avoid the user interaction while during VBR Server installation .

It leads to another issue. I was getting another "Windows Installer" pop which explains all the usage of parameters (Eg: /i Installing product, /x Uninstalling product like that explains all the parameter). If I click OK it move to the next block and skip installing the VBR.

Can you please help me here.

Regards
Leo
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: Help with Veeam 10 unattended installation

Post by jhoughes » 1 person likes this post

I wrote a complete unattended installation script for v10, rather than only focusing on an upgrade.

You can find the code for it on VeeamHub as well (here), and it should have the switches that you are looking for with the MSI installers.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Joe (jhoughes),

Great to hear. Thanks much.

Let me check it right away.

I have one query below script should I use. I am able to see 4 scripts are there.

Adding v10 Unattended Install script.ps1
Install_Veeam.ps1
VeeamConfigVariables.ps1
VeeamInstallFunctions.ps1

Looking for forward to hear from you.

Regards
Leo.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Help with Veeam 10 unattended installation

Post by oleg.feoktistov » 1 person likes this post

Hi Leo,

I see only 3 scripts there. I'd recommend checking script instructions wrapped in <# #> at the very beginning of Install_Veeam.ps1.
Also, you would need all those files. Install_Veeam.ps1 depends on other two.

Thanks,
Oleg
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: Help with Veeam 10 unattended installation

Post by jhoughes » 1 person likes this post

Yes, since you are running your own installation script, I was only suggesting to check the usage of the MSI installers within the Install_Veeam.ps1 script file.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Joe,
Your script is fantastic. Its very useful for everyone. Thanks much.

Hi Oleg,
Thanks very much for reply. To be frank I am clueless since i am beginner in scripting. I have tried everything from Joe's script still I am getting those pop-ups. I don't know which switch and where exactly I need to add in my script avoid the manual interaction.

I have added the switch in-front of VBR Server.x64.msi. Can you please someone tell me where I need to add in my script
Regards
Leo.
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: Help with Veeam 10 unattended installation

Post by jhoughes » 1 person likes this post

You need to remove the '/passive' switch in your MSI arguments, and switch it to '/qn'.

Otherwise, check each of your here-strings for MSI arguments against what we have documented for each installer:

https://helpcenter.veeam.com/docs/backu ... ml?ver=110
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Hi Joe (jhoughes) & Oleg,

Thanks a lot for your precious support Joe (jhoughes). Its working now. It means a lot. Earlier I have used in wrong place. You fixed my issue.

Thanks a lot oleg as well you have already mentioned the /qn but I placed in the wrong place. Its my mistake. I apologize.

Regards
Leo.
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: Help with Veeam 10 unattended installation

Post by jhoughes » 1 person likes this post

Glad you got it sorted, I missed it earlier myself when scrolling through the code.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Leo0601
Enthusiast
Posts: 88
Liked: 8 times
Joined: Oct 13, 2020 1:40 pm
Full Name: Leo
Contact:

Re: Help with Veeam 10 unattended installation

Post by Leo0601 »

Cheers !!! :-)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests