minor changes
This commit is contained in:
@@ -12,18 +12,20 @@ switch ( $Edition.ToLower() ) {
|
|||||||
# Install and import additional Powershell module
|
# Install and import additional Powershell module
|
||||||
Import-MSP360Module
|
Import-MSP360Module
|
||||||
|
|
||||||
# Add backup user to installed product
|
# Exit this script if the agent is not installed
|
||||||
#Try {
|
If ( !($(Get-MBSAgent -ErrorAction SilentlyContinue)) ) {
|
||||||
# $MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
|
Microsoft.Powershell.Utility\Write-Output "Backup agent is not installed. This script will now exit."
|
||||||
# Write-Output "Adding backup user account: ${MSP360Username}"
|
Return
|
||||||
# Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password
|
}
|
||||||
#}
|
|
||||||
#Catch { Write-Error $_.Exception.Message }
|
|
||||||
|
|
||||||
# Set the agent edition
|
# 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"""
|
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 }
|
Catch { Write-Error $_.Exception.Message }
|
||||||
|
|
||||||
# Delete the desktop icon
|
# Delete the desktop icon
|
||||||
|
|||||||
Reference in New Issue
Block a user