diff --git a/Fix-EmberkomCloudBackupProductEdition.ps1 b/Fix-EmberkomCloudBackupProductEdition.ps1 new file mode 100644 index 0000000..6638293 --- /dev/null +++ b/Fix-EmberkomCloudBackupProductEdition.ps1 @@ -0,0 +1,32 @@ +# This script requires the $Edition variable is set from the RMM script +If (! $Edition ) { $Edition = 'desktop' } + +# 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 additional Powershell module +Install-MSP360Module +Import-Module -Name MSP360 + +# Add backup user to installed product +Try { + $MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force + LogMsg "Adding backup user account: ${MSP360Username}" + Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password +} +Catch { LogErr $_.Exception.Message } + +# Set the agent edition +# Note: the product edition must be set *after* the user is added +LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition""" +Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose } +Catch { LogErr $_.Exception.Message } + +# Delete the desktop icon +"${Env:PUBLIC}\Desktop\Emberkom Backup.LNK", +"${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" | Remove-File \ No newline at end of file