Files
management-scripts/Fix-EmberkomCloudBackupProductEdition.ps1
T

32 lines
1.2 KiB
PowerShell
Raw Normal View History

2022-12-15 13:35:21 -05:00
# 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() ) {
2023-01-04 10:41:10 -05:00
'server' { $AgentEdition = 'baremetal' }
'desktop' { $AgentEdition = 'desktop' }
'vm' { $AgentEdition = 'vmedition' }
default { $AgentEdition = 'desktop' }
2022-12-15 13:35:21 -05:00
}
# Install and import additional Powershell module
Install-MSP360Module
Import-Module -Name MSP360
# Add backup user to installed product
2022-12-16 12:15:18 -05:00
#Try {
# $MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
2023-10-05 13:11:38 -04:00
# Write-Output "Adding backup user account: ${MSP360Username}"
2022-12-16 12:15:18 -05:00
# Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password
#}
2023-10-05 13:17:18 -04:00
#Catch { Write-Error $_.Exception.Message }
2022-12-15 13:35:21 -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"""
2022-12-15 13:35:21 -05:00
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2022-12-15 13:35:21 -05:00
# Delete the desktop icon
"${Env:PUBLIC}\Desktop\Emberkom Backup.LNK",
"${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" | Remove-File