fix
This commit is contained in:
@@ -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 }
|
||||
Reference in New Issue
Block a user