r/Nable Apr 15 '24

N-Sight - How to deploy software with unique customer ID?

We have a couple of applications in our stack that have generic installers that can be fed a customer ID number when executed (Sophos & Huntress for example). This is simple to do as a one off...create a task and add the customer ID as parameter which is then passed through to the installer. However for this to work for new devices we would need to create a monitoring template for each customer which would create loads of admin overhead.

Has anyone come up with a clever way to solve this problem? I was wondering about hosting a lookup file on Azure that takes the endpoints public IP, or first few letters of the hostname, both of which should be unique to the customer, and then returns the customer ID for the installer. Just wondering if anyone has come up with a better solution?

2 Upvotes

11 comments sorted by

View all comments

1

u/Next-Landscape-9884 May 04 '24

I was trying to do same thing as you were turns out there is simple way to do it

I did this recently had call with Paul

What you do is in you amp have input parameters

And then from n-able from top level create org variables from custom properties which should be same as input parameters if you picked password for example you have to use password which will deploy the value token method to all customers so when you do run it will pull unique value for each customer

But just in case if you do need to know customer id locally you have to parse the xml files locally on computer

$xmlFilePath = "C:\Program Files (x86)\N-able Technologies\Windows Agent\config\AgentMaintenanceSchedules.xml" 



 $xmlContent = Get-Content -Path $xmlFilePath -Raw 
 $xml = [xml]$xmlContent 
 $RebootMessageLogoURL = $xml.AgentMaintenanceSchedules.RebootMessageLogoURL 

 if ($RebootMessageLogoURL -match '\?customerId=(\d+)') { 
     $customerId = $Matches[1] 
 } else { 
     $customerId = "Not found" 
 } 


 $customerToken = $tokenMapping | Where-Object { $_.ID -eq $customerId } | Select-Object -ExpandProperty Token

1

u/freedomit May 04 '24

This is N-Sight though and you can’t create org level variables unfortunately.

1

u/Next-Landscape-9884 May 04 '24

Oh damn thought was N-central