From 0ddd5c801ac2deee1d0097e75e3172933485caa1 Mon Sep 17 00:00:00 2001 From: dyoder Date: Wed, 22 Sep 2021 14:51:23 -0400 Subject: [PATCH] major update to backup agent installation --- Install-EmberkomCloudBackup.ps1 | 30 +++++++++++++++++++++++++++++ Install-MSP360PowershellModule.ps1 | 5 +++-- Set-MSP360EditionDesktop.ps1 | 4 ---- rmm/Install-EmberkomCloudBackup.ps1 | 2 ++ rmm/Set-MSP360EditionDesktop.ps1 | 2 -- 5 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 Install-EmberkomCloudBackup.ps1 delete mode 100644 Set-MSP360EditionDesktop.ps1 create mode 100644 rmm/Install-EmberkomCloudBackup.ps1 delete mode 100644 rmm/Set-MSP360EditionDesktop.ps1 diff --git a/Install-EmberkomCloudBackup.ps1 b/Install-EmberkomCloudBackup.ps1 new file mode 100644 index 0000000..4a65899 --- /dev/null +++ b/Install-EmberkomCloudBackup.ps1 @@ -0,0 +1,30 @@ +## Set the edition of the agent: "server" "desktop" or "vm" +$Edition = '{[Edition]}' + +## Specify URL to "Backup for Windows" agent installer +$ECB_WIN_URL = 'https://s3.amazonaws.com/cb_setups/MBS/53CFB286-7A97-4FDF-8CFA-475C0DB63A9A/EmberkomEmberkomBackup_v7.2.0.280_netv4.0_ALLEDITIONS_Setup_20210914204936.exe' + +## Specify URL to "Backup Virtual Machine Edition" agent installer +$ECB_VMM_URL = 'https://s3.amazonaws.com/cb_setups/MBS/53CFB286-7A97-4FDF-8CFA-475C0DB63A9A/EmberkomEmberkomBackup_v7.2.0.280_netv4.0_VM_Setup_20210914205143.exe' + +## Set the correct download URL and agent edition +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' } +} + +## Install and import the MSP360 Powershell module +Run-Script -LivePSScript Install-MSP360PowershellModule +Import-Module -Name MSP360 + +## Install the agent +LogMsg "Installing Emberkom Cloud Backup agent" +Try { Install-MBSAgent -URL $URL -Force } +Catch { LogErr $_.Exception.Message } + +## Set the agent edition +LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition""" +Try { Set-MBSAgentSetting -Edition $AgentEdition } +Catch { $_.Exception.Message } \ No newline at end of file diff --git a/Install-MSP360PowershellModule.ps1 b/Install-MSP360PowershellModule.ps1 index ade9981..7511698 100644 --- a/Install-MSP360PowershellModule.ps1 +++ b/Install-MSP360PowershellModule.ps1 @@ -1,2 +1,3 @@ -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA')+'Install-MSP360Module') \ No newline at end of file +LogMsg "Downloading and installing MSP360 Powershell module if not already installed" +Try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA'); Install-MSP360Module } +Catch { LogErr $_.Exception.Message } \ No newline at end of file diff --git a/Set-MSP360EditionDesktop.ps1 b/Set-MSP360EditionDesktop.ps1 deleted file mode 100644 index c82b3a5..0000000 --- a/Set-MSP360EditionDesktop.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -Import-Module -Name msp360 - -## Set the agent edition to Desktop -Set-MBSAgentSetting -Edition desktop \ No newline at end of file diff --git a/rmm/Install-EmberkomCloudBackup.ps1 b/rmm/Install-EmberkomCloudBackup.ps1 new file mode 100644 index 0000000..ce4461c --- /dev/null +++ b/rmm/Install-EmberkomCloudBackup.ps1 @@ -0,0 +1,2 @@ +. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) +Run-Script -LivePSScript Install-EmberkomCloudBackup \ No newline at end of file diff --git a/rmm/Set-MSP360EditionDesktop.ps1 b/rmm/Set-MSP360EditionDesktop.ps1 deleted file mode 100644 index 00f48eb..0000000 --- a/rmm/Set-MSP360EditionDesktop.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Set-MSP360EditionDesktop \ No newline at end of file