updates and remove rmm directory since that now contains non-public info

This commit is contained in:
2021-09-23 09:09:41 -04:00
parent 3666f647ff
commit 01805d6614
38 changed files with 42 additions and 86 deletions
+29 -2
View File
@@ -17,15 +17,42 @@ switch ( $Edition.ToLower() ) {
## Install and import the MSP360 Powershell module
Run-Script -LivePSScript Install-MSP360PowershellModule
LogMsg "Importing MSP360 Powershell module"
Import-Module -Name MSP360
## Install the agent
LogMsg "Installing Emberkom Cloud Backup agent"
$INSTALLER = Download-File -URL $URL
LogMsg "Installing Emberkom Cloud Backup agent"
Try { Start-Process $INSTALLER -ArgumentList "/S" -Wait }
Catch { LogErr $_.Exception.Message }
If ( Test-Path $INSTALLER ) {
LogMsg "Deleting Emberkom Cloud Backup agent installer: ""${INSTALLER}"""
Try { Remove-Item $INSTALLER -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 }
Catch { $_.Exception.Message }
## Install and import the PSAtera Powershell Module
Run-Script -LivePSScript Install-PSAteraModule
LogMsg "Importing PSAtera Powershell module"
Import-Module -Name PSAtera
Set-AteraAPIKey = $AteraAPIKey
## Get agent details and custom fields from Atera
LogMsg "Getting Atera agent and custom field information"
Try {
$AteraAgent = Get-AteraAgent
$MSP360Username = Get-AteraCustomValue -ObjectType Customer -ObjectId $agent.CustomerID -FieldName 'MSP360 Account Username'
$MSP360Password = Get-AteraCustomValue -ObjectType Customer -ObjectId $agent.CustomerID -FieldName 'MSP360 Account Password'
$MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
}
Catch { LogErr $_.Exception.Message }
## Add account and password
LogMsg "Adding backup user account: ${MSP360Username}"
Try { Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password }
Catch { LogErr $_.Exception.Message }