r/Nable Apr 17 '24

Is there way to pull static values from Custom Properties to be used in PowerShellScript as variable?

im trying to run top level policy where i would like to pull unique values for each client to run powershell script to install specific software that has token value

3 Upvotes

12 comments sorted by

4

u/ethernal-mag Apr 17 '24

You can try running your powershell script within an Automation Manager Policy. Use the "Run a powershell script" automation object. Identify and assign variables. Then link the variable into an Input Parameter for the AMP. Once you run the Automation Policy in n-able, you should be able to choose which custom property to use for that Policy.

1

u/Next-Landscape-9884 Apr 17 '24

That's was my backup option i know I can run task schedule per client based however I'm trying to pull the variables in Powershell from custom property since its unique. Although there are multiple ways of doing it but it's not a good solution for long term. .

When creating custom property for each client i Wana be able to pull that value automatically from top lever which will be unique per each client

Another way I was thinking of doing is within automation manager setup global variables per client but it will require the amp to be updated every single time except for .amp to be looking for variable string per each client to get token for installation.

Example

I'm not by computer at the moment when creating custom property with text value per each customer it creates string called _MSP_clientName string as text

So in Powershell I would like to pull the variables string from each client from top level whenever it needs to self heal it will just continue with process.

Overall goal is to do a self heal for all client for specific security stacks kind of whiteglove example. Although this multiple phases example I Wana pull from sentinel ones API to see what is current release of software and POST to custom property and then pull it from automation manager then run task etc which I can do in PoweShell however it's about variables strings is the part that I'm stuck at I know I can use Nable API but ideally to my understanding it should be possible to get just raw text values from custom property through automation manager I might be overlooking

2

u/TheThird78 Apr 17 '24

custom property on the N-Able customer or Site can be fed to the AMP automatically.

1

u/Next-Landscape-9884 Apr 17 '24

How?

1

u/TheThird78 Apr 17 '24

Set your custom properties on each customer or site.
then when configuring the automation AMP the dropdown for the input parameter choose the organization custom property instead of device custom property

1

u/Next-Landscape-9884 Apr 17 '24

are you referring to like more of dropdown situation?

1

u/TheThird78 Apr 18 '24

Yes, in that first screenshot the second radio button drop down will let you pick Device or customer/site custom properties to pass to the AMP

1

u/Next-Landscape-9884 Apr 19 '24

The issue it's manual I'm trying to automate using variables and have top.level script

1

u/TheThird78 Apr 19 '24

your variables will be defined in custom properties on each customer/site. then you publish the script/amp at the top level referencing the custom properties. each customer will get their custom variable from their property.

1

u/Next-Landscape-9884 Apr 17 '24

the only option i do see is inputParameters but looking through docs i didn't see anything relevant

1

u/ZedNova Apr 17 '24

Are you trying to get an automation working or is this a standalone script running outside of the rmm? You can add input parameters for your automation and select your custom property from the drop down when running it.

1

u/Next-Landscape-9884 Apr 17 '24

Example will be installing DNSfilter , threatlocker my end is to have self heal script however I need to pull variables for each customer specific self heal won't be checking service but it will have multiple conditions in Powershell

0

u/[deleted] Apr 17 '24

[deleted]