This commit is contained in:
2021-09-23 11:35:59 -04:00
parent 01805d6614
commit 2b8d833100
+5 -8
View File
@@ -43,16 +43,13 @@ Import-Module -Name PSAtera
Set-AteraAPIKey = $AteraAPIKey
## Get agent details and custom fields from Atera
LogMsg "Getting Atera agent and custom field information"
Try {
LogMsg "Getting Atera agent and custom field information"
$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'
$MSP360Username = Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'MSP360 Account Username'
$MSP360Password = Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'MSP360 Account Password'
$MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force
LogMsg "Adding backup user account: ${MSP360Username}"
Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password
}
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 }