minor changes

This commit is contained in:
2024-02-01 11:03:10 -05:00
parent 76f03b124d
commit d542a56ed7
+11 -9
View File
@@ -12,18 +12,20 @@ switch ( $Edition.ToLower() ) {
# Install and import additional Powershell module
Import-MSP360Module
# Add backup user to installed product
#Try {
# $MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
# Write-Output "Adding backup user account: ${MSP360Username}"
# Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password
#}
#Catch { Write-Error $_.Exception.Message }
# Exit this script if the agent is not installed
If ( !($(Get-MBSAgent -ErrorAction SilentlyContinue)) ) {
Microsoft.Powershell.Utility\Write-Output "Backup agent is not installed. This script will now exit."
Return
}
# Set the agent edition
# Note: the product edition must be set *after* the user is added
Write-Output "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
Try {
Switch ([string]::IsNullOrEmpty($MasterPassword)) {
$true { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
$false { Set-MBSAgentSetting -Edition $AgentEdition -MasterPassword (ConvertTo-SecureString -String $MasterPassword -AsPlainText -Force) -Verbose }
}
}
Catch { Write-Error $_.Exception.Message }
# Delete the desktop icon