PowerShell script exchange
Post Reply
Boba
Novice
Posts: 4
Liked: never
Joined: Dec 21, 2018 1:11 pm
Contact:

Deploy Veeam Bkp via Powershell

Post by Boba »

Hello there :D

We will deploy 180 physicals Windows 2016 servers with the same configuration, we need industrialized the installation of Veeam Backup & Rep with powershell.

In fact, it's literally 180 differents custemers, domains and network so no installation with the Veeam Console, it's the same configuration but no link to each other.

Every physical server will be a Hyper-V with Veeam Backup & Repl for Hyper-V installed on it (Veeam Bkp server + Server Proxy role) for the backup of the Vms inside.

So we need to industrialize the process with powershell for this 3 steps:

-Install the Veeam Backup & Replication product on physical server Hyper-V
-Install the license
-Import the jobs bkp

Do you have deployment tools? How we can do that with powershell?

Thank you all by advance!

Cdly
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: Deploy Veeam Bkp via Powershell

Post by jhoughes »

You should start with this for PowerShell based deployment on Hyper-V. Dave Kawula did a great job with this.

It will obviously require tweaking, as it's intended to deploy onto a Hyper-V VM, but this will be much closer than a VMware based deployment script to start from.

https://www.veeam.com/blog/deploy-using ... guide.html
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Boba
Novice
Posts: 4
Liked: never
Joined: Dec 21, 2018 1:11 pm
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by Boba »

Thank you for your answer, i will take a look on this.
Boba
Novice
Posts: 4
Liked: never
Joined: Dec 21, 2018 1:11 pm
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by Boba »

Hello, thank you i manage to do something with the great job of Dave Kawula :)
But i got a problem when i want to open the VBR Console after the installation, the connection with the local SQL Server doesn't work. As to me, it's clearly an authentification or an installation failed, the firewall is disable for the test.

Inside the "05_backup.txt" log, we can read:
[24.01.2019 16:25:51]:<00000001> [VEEAM] Connecting to SQL Server (CurrentUser=[HYP1IPDV\svc-veeam], ServerInstance=[HYP1IPDV\VEEAMSQL2012], Options=[Direct])
[24.01.2019 16:25:51]:<00000001> [VEEAM] Removing 'Initial Catalog' property from connection string
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] Failed to connect to server . (Microsoft.SqlServer.Management.Common.ConnectionFailureException)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Veeam.Backup.DBCreator.DatabaseConnector.Connect(DatabaseConnectorOptions options)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] Une erreur liée au réseau ou spécifique à l'instance s'est produite lors de l'établissement d'une connexion à SQL Server. Le serveur est introuvable ou n'est pas accessible. Vérifiez que le nom de l'instance est correct et que SQL Server est configuré pour autoriser les connexions distantes. (provider: SQL Network Interfaces, error: 26 - Erreur lors de la localisation du serveur/de l'instance spécifiés) (System.Data.SqlClient.SqlException)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à System.Data.SqlClient.SqlConnection.Open()
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect(WindowsIdentity impersonatedIdentity)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
[24.01.2019 16:26:06]:<00000001> [VEEAM] Disconnecting from SQL Server (ServerInstance=[HYP1IPDV\VEEAMSQL2012])
[24.01.2019 16:26:06]:<00000001> [VEEAM] Connection is terminated
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] Unable to connect to SQL Server HYP1IPDV\VEEAMSQL2012. Une erreur liée au réseau ou spécifique à l'instance s'est produite lors de l'établissement d'une connexion à SQL Server. Le serveur est introuvable ou n'est pas accessible. Vérifiez que le nom de l'instance est correct et que SQL Server est configuré pour autoriser les connexions distantes. (provider: SQL Network Interfaces, error: 26 - Erreur lors de la localisation du serveur/de l'instance spécifiés) (Veeam.Backup.DBCreator.DatabaseException)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Veeam.Backup.DBCreator.DatabaseConnector.Connect(DatabaseConnectorOptions options)
[24.01.2019 16:26:06]:<00000001> [VEEAM|ERROR] à Veeam.Backup.DBCreator.DatabaseConnectionTester.Test(Exception& error)
The part of the script for the SQL installation, /SQLSVCACCOUNT=`"NT AUTHORITY\SYSTEM`" /SQLSYSADMINACCOUNTS=`"$fulluser`" `"Builtin\Administrators`" with $fulluser account variable incremented in the beginning of the script.
### SQL Express
### Info: https://msdn.microsoft.com/en-us/library/ms144259.aspx
Write-Host " Installing SQL Express ..." -ForegroundColor Yellow
$Arguments = "/HIDECONSOLE /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /FEATURES=SQLEngine,SNAC_SDK /INSTANCENAME=VEEAMSQL2012 /SQLSVCACCOUNT=`"NT AUTHORITY\SYSTEM`" /SQLSYSADMINACCOUNTS=`"$fulluser`" `"Builtin\Administrators`" /TCPENABLED=1 /NPENABLED=1 /UpdateEnabled=0"
Start-Process "$source\Redistr\x64\SQLEXPR_x64_ENU.exe" -ArgumentList $Arguments -Wait -NoNewWindow
I installed MSQL Server Mgmt Studio to check the database and try to connect in but same story (Check the name of the instance, your account or your network error 26)

Do you already met the same problem? Did i miss something during the authentification?

Thank you by advance for your answers.
Boba
Novice
Posts: 4
Liked: never
Joined: Dec 21, 2018 1:11 pm
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by Boba »

Hi,

Still don't work with the installation of the MSSQL2012 on my windows 2016 for Veeam Backup & Replication 9.5 update3..

So, i try with the update 4 who need MSSQL2016 instead of the 2012, this is the script i use:

#region: Variables
$source = "C:\*****\Sources\Veeam"
$licensefile = "$source\_SOURCES\veeam_backup_*****.lic"
$username = "svc_veeam"
$fulluser = $env:COMPUTERNAME+ "\" + $username
$password = "*****"
$CatalogPath = "C:\VbrCatalog"
$vPowerPath = "C:\vPowerNfs"
#endregion

#region: logdir
$logdir = "C:\*****\logs"
$trash = New-Item -ItemType Directory -path $logdir -ErrorAction SilentlyContinue
#endregion

#region: Installation
# Info: https://www.veeam.com/unattended_installation_ds.pdf

## Global Prerequirements
Write-Host "Installing Global Prerequirements ..." -ForegroundColor Yellow
### 2012 System CLR Types
Write-Host " Installing 2012 System CLR Types ..." -ForegroundColor Yellow
$MSIArguments = @(
"/i"
"$source\Redistr\x64\SQLSysClrTypes.msi"
"/qn"
"/norestart"
"/L*v"
"$logdir\01_CLR.txt"
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow

### 2012 Shared management objects
Write-Host " Installing 2012 Shared management objects ..." -ForegroundColor Yellow
$MSIArguments = @(
"/i"
"$source\Redistr\x64\SharedManagementObjects.msi"
"/qn"
"/norestart"
"/L*v"
"$logdir\02_Shared.txt"
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow


### SQL Express
### Info: https://msdn.microsoft.com/en-us/library/ms144259.aspx
Write-Host " Installing SQL Express ..." -ForegroundColor Yellow
$Arguments = "/HIDECONSOLE /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /FEATURES=SQLEngine,SNAC_SDK /INSTANCENAME=VEEAMSQL2016 /SQLSVCACCOUNT=`"NT AUTHORITY\SYSTEM`" /SQLSYSADMINACCOUNTS=`"$fulluser`" `"Builtin\Administrators`" /TCPENABLED=1 /NPENABLED=1 /UpdateEnabled=0"
Start-Process "$source\Redistr\x64\SqlExpress\2016SP1\SQLEXPR_x64_ENU.exe" -ArgumentList $Arguments -Wait -NoNewWindow

## Veeam Backup & Replication
Write-Host "Installing Veeam Backup & Replication ..." -ForegroundColor Yellow
### Backup Catalog
Write-Host " Installing Backup Catalog ..." -ForegroundColor Yellow
$trash = New-Item -ItemType Directory -path $CatalogPath -ErrorAction SilentlyContinue
$MSIArguments = @(
"/i"
"$source\Catalog\VeeamBackupCatalog64.msi"
"/qn"
"/L*v"
"$logdir\04_Catalog.txt"
"VM_CATALOGPATH=$CatalogPath"
"VBRC_SERVICE_USER=$fulluser"
"VBRC_SERVICE_PASSWORD=$password"
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow

### Backup Server
Write-Host " Installing Backup Server ..." -ForegroundColor Yellow
$trash = New-Item -ItemType Directory -path $vPowerPath -ErrorAction SilentlyContinue
$MSIArguments = @(
"/i"
"$source\Backup\Server.x64.msi"
"/qn"
"/L*v"
"$logdir\05_Backup.txt"
"ACCEPTEULA=YES"
"VBR_LICENSE_FILE=$licensefile"
"VBR_SERVICE_USER=$fulluser"
"VBR_SERVICE_PASSWORD=$password"
"PF_AD_NFSDATASTORE=$vPowerPath"
"VBR_SQLSERVER_SERVER=$env:COMPUTERNAME\VEEAMSQL2016"
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow

### Backup Console
Write-Host " Installing Backup Console ..." -ForegroundColor Yellow
$MSIArguments = @(
"/i"
"$source\Backup\Shell.x64.msi"
"/qn"
"/L*v"
"$logdir\06_Console.txt"
"ACCEPTEULA=YES"
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow


#endregion

Issues during the catalog installation:
Product: Veeam Backup Catalog -- Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action ThirdPartyCheck, location: C:\Windows\Installer\MSI56.tmp, command: /cancel

Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action ThirdPartyCheck, location: C:\Windows\Installer\MSI56.tmp, command: /cancel
Issues during the Backup installation:
Product: Veeam Backup & Replication Server -- Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action ThirdPartyCheck, location: C:\Windows\Installer\MSI628.tmp, command: /cancel

Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action ThirdPartyCheck, location: C:\Windows\Installer\MSI628.tmp, command: /cancel

Issues during the Console installation:
Product: Veeam Backup & Replication Console -- Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action ThirdPartyCheck, location: C:\Windows\Installer\MSI2762.tmp, command: /cancel
Any ideas this time? Anyone who already installed the VBR 9.5 update 4 with a script?
Thank you by advance.
powercleee
Novice
Posts: 3
Liked: 1 time
Joined: Apr 04, 2019 4:34 pm
Full Name: Jeremiah Monk
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by powercleee »

Try adding "ACCEPT_THIRDPARTY_LICENSES=1" under the MSIArguments for the Backup Server install
Markus.K1985
Expert
Posts: 103
Liked: 28 times
Joined: Dec 08, 2014 2:30 pm
Full Name: Markus Kraus
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by Markus.K1985 »

The additional argument "ACCEPT_THIRDPARTY_LICENSES=1" works. Thanks for the hint!

The default setup behavior is 'VBRC_SERVICE_ACCOUNT_TYPE=1' instead of a given user.
hdang90
Lurker
Posts: 1
Liked: never
Joined: Sep 10, 2019 10:50 pm
Full Name: Henry Dang
Contact:

[MERGED] Powershell Script to install Veeam Backup and Replication

Post by hdang90 »

Hi - I was wondering if anyone here have a powershell script to install Veeam Backup and Replication?

My environment is all VMware.
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Deploy Veeam Bkp via Powershell

Post by Natalia Lupacheva »

Hi Henry,

Moved your post to the existing thread. Please review the mentioned blog post and the discussions above. Hope it helps!

Thanks!
Post Reply

Who is online

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