2 Replies Latest reply on May 2, 2014 3:29 AM by Alvaro Gonzalez

    Passing server property to NSH

    Mark Casey

      Ok, I don't even know if I'm wanted to use an NSH or not, but I thought I would start there.


      What I'm trying to accomplish is run a command on every server I have, and a parameter of that command, I want it to be the value of a server property.


      A batch file would look like this:


      cd "C:\Program Files (x86)\McAfee\Common Framework"

      msaconfig.exe -CustomProps1 "<ValueOfServerPropertyGoesHere>"

      cmdagent.exe /P


      The server property value would be specific to the server this command is being run on.


      Any help would be greatly appreciated.




        • 1. Re: Passing server property to NSH
          Bill Robinson

          put that into an 'external command' of a blpackage and pass in the property like ??TARGET.BLAH??

          • 2. Re: Passing server property to NSH

            If you want to use NSH, follow these steps:


            - Create a NSH script type 1 into your Depot folder.


            - In the step 2/4 of the 'Add NSH Script' Wizard, add a parameter with the + key located in the upper right corner of the window.

            • Name: A name to identify the parameter.
            • Default value: The property you want to use. If it is a server property, it will probably be in TARGET folder. Select the one you need. It will appear as ??TARGET.PROPERTY?? once you have selected it.
            • Editable: Select this option if you want your parameter to be changed at any time after the script has been created. For example, if you think that you are going to change the server property in different executions of the NSH Script Job.


            - Start writting your script. Your script will receive the parameter you previously added as $1 if it is the only parameter it receives or as $x where 'x' is the order of the parameter inside the list of parameters (first parameter: $1, second parameter: $2 and so on). Your script (if your property is the first one) would be something like:




            cd "C:\Program Files (x86)\McAfee\Common Framework"

            msaconfig.exe -CustomProps1 "$SERVER_PROPERTY"

            cmdagent.exe /P



            - Create your NSH Script Job as usual.


            - If you open your Job, your property will appear in the 'Parameters' tab. If you selected the 'Editable' option, you will be able to change its value for different executions of the job.


            - Execute the job against the desired servers.