From 9965fdd2ea6dd537fe78522352a430ed372b2bc2 Mon Sep 17 00:00:00 2001 From: Madzone Date: Wed, 12 Aug 2026 10:22:55 +0200 Subject: [PATCH] Version 2.0.1 --- VEEAM-INSTALL/Configure-VeeamEnvironment.ps1 | 53 ------------------ VEEAM-INSTALL/Install-VeeamEnterprise.ps1 | 57 ++++++++++++++------ VEEAM-INSTALL/Modules/Core/Bootstrap.psm1 | 4 +- VEEAM-INSTALL/README.md | 6 +++ 4 files changed, 48 insertions(+), 72 deletions(-) delete mode 100644 VEEAM-INSTALL/Configure-VeeamEnvironment.ps1 diff --git a/VEEAM-INSTALL/Configure-VeeamEnvironment.ps1 b/VEEAM-INSTALL/Configure-VeeamEnvironment.ps1 deleted file mode 100644 index dee28e5..0000000 --- a/VEEAM-INSTALL/Configure-VeeamEnvironment.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -param( - [Parameter(Mandatory)] - [ValidateSet("VMware", "HyperV", "Proxmox")] - [string]$Platform, - - [Parameter(Mandatory)] - [string]$Server, - - [PSCredential]$Credential, - - [switch]$DryRun -) - -Set-StrictMode -Version Latest -$ErrorActionPreference = "Stop" -$Root = $PSScriptRoot - -$RequiredModules = @( - "Modules\Veeam\BackupJobs.psm1", - "Modules\Platforms\$Platform.psm1" -) - -foreach($Module in $RequiredModules) { - Import-Module (Join-Path $Root $Module) -Force -ErrorAction Stop -} - -$Configuration = Get-Content (Join-Path $Root "Config\VeeamConfig.json") -Raw | ConvertFrom-Json - -if($Platform -eq "Proxmox" -and $null -eq $Credential) { - $Credential = Get-Credential -Message "Proxmox API-Token-ID und Token-Secret eingeben" -} - -switch($Platform) { - "VMware" { $VirtualMachines = @(Get-VMwareInventory -Server $Server) } - "HyperV" { $VirtualMachines = @(Get-HyperVInventory -Server $Server) } - "Proxmox" { $VirtualMachines = @(Get-ProxmoxInventory -Server $Server -ApiCredential $Credential) } -} - -$Schedules = New-AlphabeticalBackupSchedules ` - -JobName $Configuration.BackupJob.Name ` - -VirtualMachines $VirtualMachines ` - -ScheduleGroups @($Configuration.BackupJob.ScheduleGroups) - -[PSCustomObject]@{ - Platform = $Platform - Server = $Server - DryRun = $DryRun.IsPresent - VirtualMachineCount = $VirtualMachines.Count - VirtualMachines = $VirtualMachines - Schedules = $Schedules - JobsCreated = $false - Message = "Inventar gelesen und Zeitplanentwurf erstellt. Es wurden keine Veeam-Jobs angelegt." -} diff --git a/VEEAM-INSTALL/Install-VeeamEnterprise.ps1 b/VEEAM-INSTALL/Install-VeeamEnterprise.ps1 index b0fee16..163d398 100644 --- a/VEEAM-INSTALL/Install-VeeamEnterprise.ps1 +++ b/VEEAM-INSTALL/Install-VeeamEnterprise.ps1 @@ -13,7 +13,7 @@ - Dry-Run Unterstützung .VERSION - 1.0.2 + 2.0.1 #> @@ -635,9 +635,20 @@ function Start-VeeamEnterpriseInstall { $Configuration = Get-InstallerConfiguration - $VeeamSourcePath = Resolve-VeeamSourcePath ` - -SourcePath $VeeamSourcePath ` - -ConfiguredPath ([string]$Configuration.Veeam.SourcePath) + $VeeamAlreadyInstalled = (!$Script:IsDryRun -and (Test-VeeamInstalled)) + + if($VeeamAlreadyInstalled) + { + Write-Host "Veeam ist bereits installiert. Setup wird übersprungen." -ForegroundColor Green + Write-EnterpriseLog -Level INFO -Message "Vorhandene Veeam-Installation erkannt; Setup wird übersprungen." + $VeeamSourcePath = "" + } + else + { + $VeeamSourcePath = Resolve-VeeamSourcePath ` + -SourcePath $VeeamSourcePath ` + -ConfiguredPath ([string]$Configuration.Veeam.SourcePath) + } $Configuration.Repository.Path = Resolve-RepositoryPath ` -Path ([string]$Configuration.Repository.Path) ` @@ -722,20 +733,32 @@ function Start-VeeamEnterpriseInstall { -Message ("SQL-Datenbank vorbereitet: {0}; Konto: {1}; Rolle: {2}" -f $SQLPreparation.Database, $SQLPreparation.ServiceAccount, $SQLPreparation.DatabaseRole) } - $VeeamAnswerFile = Resolve-VeeamAnswerFile ` - -AnswerFile $VeeamAnswerFile ` - -SourcePath $VeeamSourcePath ` - -LocalConfigPath (Join-Path $Script:InstallerRoot "Config") ` - -DatabaseEngine $Configuration.SQL.Engine ` - -SQLServer $Configuration.SQL.Server ` - -SQLInstance $Configuration.SQL.Instance ` - -DatabaseName $Configuration.SQL.Database - - $Installation = - Install-VeeamProduct ` - -Configuration $Configuration ` + if($VeeamAlreadyInstalled) + { + $Installation = [PSCustomObject]@{ + Status = "AlreadyInstalled" + SetupSkipped = $true + InstallationPath = Get-VeeamInstallationPath + Version = Get-VeeamVersion + } + } + else + { + $VeeamAnswerFile = Resolve-VeeamAnswerFile ` + -AnswerFile $VeeamAnswerFile ` -SourcePath $VeeamSourcePath ` - -AnswerFile $VeeamAnswerFile + -LocalConfigPath (Join-Path $Script:InstallerRoot "Config") ` + -DatabaseEngine $Configuration.SQL.Engine ` + -SQLServer $Configuration.SQL.Server ` + -SQLInstance $Configuration.SQL.Instance ` + -DatabaseName $Configuration.SQL.Database + + $Installation = + Install-VeeamProduct ` + -Configuration $Configuration ` + -SourcePath $VeeamSourcePath ` + -AnswerFile $VeeamAnswerFile + } if($null -eq (Get-Module -ListAvailable -Name "Veeam.Backup.PowerShell")) diff --git a/VEEAM-INSTALL/Modules/Core/Bootstrap.psm1 b/VEEAM-INSTALL/Modules/Core/Bootstrap.psm1 index e5ab325..76f0a14 100644 --- a/VEEAM-INSTALL/Modules/Core/Bootstrap.psm1 +++ b/VEEAM-INSTALL/Modules/Core/Bootstrap.psm1 @@ -2,7 +2,7 @@ --------------------------------------------------------------------------- Module......: Bootstrap.psm1 Projekt.....: Veeam Enterprise Installer - Version.....: 2.0.0 + Version.....: 2.0.1 Autor.......: ChatGPT & Benutzer PowerShell..: 5.1 --------------------------------------------------------------------------- @@ -29,7 +29,7 @@ Set-StrictMode -Version Latest #region Script Variablen $Script:ProjectName = "Veeam Enterprise Installer" -$Script:ProjectVersion = "2.0.0" +$Script:ProjectVersion = "2.0.1" $Script:RootPath = $null $Script:ModulePath = $null diff --git a/VEEAM-INSTALL/README.md b/VEEAM-INSTALL/README.md index bce679a..727afd2 100644 --- a/VEEAM-INSTALL/README.md +++ b/VEEAM-INSTALL/README.md @@ -2,6 +2,8 @@ PowerShell-basierter Installer zur automatisierten Installation und Grundkonfiguration von Veeam Backup & Replication auf Windows Server. +**Projektversion:** 2.0.1 + > **Status:** Entwicklung und Test. Vor einem produktiven Einsatz vollständig in einer isolierten Testumgebung prüfen. ## Funktionen @@ -49,6 +51,10 @@ Installation mit automatisch erkanntem Installationsmedium starten: .\Install-VeeamEnterprise.ps1 ``` +Ist Veeam bereits installiert, überspringt das Skript den Setup-Schritt und +setzt die Konfiguration von Repository und Backup-Jobs fort. Dadurch kann der +Lauf nach einem erforderlichen Neustart sicher wieder aufgenommen werden. + Installationsmedium und Antwortdatei können auch explizit angegeben werden: ```powershell