Files
management-scripts/Install-EmberkomCloudBackup.ps1
T

47 lines
2.1 KiB
PowerShell
Raw Normal View History

2022-12-15 13:33:26 -05:00
# This script requires the $Edition variable is set from the RMM script
2021-09-22 16:22:14 -04:00
If (! $Edition ) { $Edition = 'desktop' }
2021-09-22 14:51:23 -04:00
2022-12-15 13:33:26 -05:00
# Specify URL to "Backup for Windows" agent installer
2023-06-02 10:47:44 -04:00
$ECB_WIN_URL = 'https://s3.amazonaws.com/cb_setups/MBS/53CFB286-7A97-4FDF-8CFA-475C0DB63A9A/Brands/FB8308E2-448A-4645-A5F6-A3632A7E57F4/EmberkomCloudBackup_v7.8.7.58_ALLEDITIONS_Setup.exe'
2021-09-22 14:51:23 -04:00
2022-12-15 13:33:26 -05:00
# Specify URL to "Backup Virtual Machine Edition" agent installer
2023-06-02 10:47:44 -04:00
$ECB_VMM_URL = 'https://s3.amazonaws.com/cb_setups/MBS/53CFB286-7A97-4FDF-8CFA-475C0DB63A9A/Brands/FB8308E2-448A-4645-A5F6-A3632A7E57F4/EmberkomCloudBackup_v7.8.7.58_VMWARE_Setup.exe'
2021-09-22 14:51:23 -04:00
2022-12-15 13:33:26 -05:00
# Set the correct download URL and agent edition
2021-09-22 14:51:23 -04:00
switch ( $Edition.ToLower() ) {
'server' { $URL = $ECB_WIN_URL; $AgentEdition = 'baremetal' }
'desktop' { $URL = $ECB_WIN_URL; $AgentEdition = 'desktop' }
'vm' { $URL = $ECB_VMM_URL; $AgentEdition = 'vmedition' }
default { $URL = $ECB_WIN_URL; $AgentEdition = 'desktop' }
}
2022-12-15 14:18:31 -05:00
# Install and import additional Powershell module
Install-MSP360Module
Import-Module -Name MSP360
# Download the installer
$Installer = Download-File -URL $URL
2022-12-15 13:33:26 -05:00
# Install the agent
2023-10-05 13:11:38 -04:00
Write-Output "Installing Emberkom Cloud Backup agent"
2022-12-15 14:18:31 -05:00
Try { Start-Process "${Installer}" -ArgumentList "/S" -Wait }
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2021-09-22 14:51:23 -04:00
2022-12-15 13:33:26 -05:00
# Add backup user to installed product
Try {
$MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
2023-10-05 13:11:38 -04:00
Write-Output "Adding backup user account: ${MSP360Username}"
2021-09-23 11:35:59 -04:00
Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password
}
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2022-12-15 13:33:26 -05:00
# Set the agent edition
# Note: the product edition must be set *after* the user is added
2023-10-05 13:11:38 -04:00
Write-Output "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2021-10-08 05:41:49 -04:00
2022-12-15 13:33:26 -05:00
# Delete the desktop icon
2023-10-06 14:16:19 -04:00
Write-Output "Removing desktop icon"
Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Backup.LNK" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" -Force -ErrorAction SilentlyContinue