From fe795e4ba1816217d36b3cbff11ce27b77c69dcb Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 7 Oct 2021 09:29:46 -0400 Subject: [PATCH] update to use atera api to get customer host url --- Install-LiquidFilesOutlookAgent.ps1 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Install-LiquidFilesOutlookAgent.ps1 b/Install-LiquidFilesOutlookAgent.ps1 index 30f6387..ab85364 100644 --- a/Install-LiquidFilesOutlookAgent.ps1 +++ b/Install-LiquidFilesOutlookAgent.ps1 @@ -1,8 +1,20 @@ ## Path to the MSI installer $MSIURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.129.msi' +Install-PSAteraModule +Import-Module -Name PSAtera + +## Get LF host URL from Atera +Try { + LogMsg "Getting LiquidFiles host URL from Atera API" + Set-AteraAPIKey -APIKey $AteraAPIKey + $AteraAgent = Get-AteraAgent + $LFHost = $(Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'LiquidFiles Host URL').ValueAsString +} +Catch { LogErr $_.Exception.Message } + ## Set installer args -If ( $LFHost ) { +If (-not [string]::IsNullOrEmpty($LFHost) ) { LogMsg "LiquidFiles target server: ${LFHost}" $INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};""" }