How to use inventory attributes in custom script

Version 1


    Sometime is useful to call a program or a script through a Custom Script and pass as parameters to it one or more value taken from the Inventory of the device where the program is executed.



    For example we need to launch the program DOMAGIC.EXE that need to have as parameter the MAC address of the device.


    To achieve this result we can create a custom script as this one:


    ; MACHINES - This section is run once for each machine in the target set.  
    ; Commands in this section will be processed in the order they are listed
    ; in the custom script.  This section supports both local (LOCxxx) and remote 
    ; (REMxxx) commands.
    REMEXEC1=c:\DOMAGIC.EXE %Computer - Network - NIC Address%

    If we need to quote the parameter (DOMAGIC.EXE "MYPARAM") we need to use %QUOTE% in the script to represent the double quote character:

    REMEXEC1=c:\DOMAGIC.EXE %QUOTE%%Computer - Network - NIC Address%%QUOTE%


    It is possible to use every kind of inventory attribute as variable following the syntax:

    %Computer - node - node - ..... - attribute%