13 Replies Latest reply on Dec 1, 2011 12:10 PM by Bill Robinson

    how to pass a parameter to an nsh script?

      I'm writing an nsh script to find all domain controllers in an environment and add them to a static group. I want to pass a value in for the parent group, as the script will be used in different datacenters. The script looks like this:

       

      HOST=`uname -n`

      SERVER_GROUP1="/Syracuse/domain_controllers"

      SERVER_GROUP1_ID=`blcli ServerGroup groupNameToId $SERVER_GROUP1`

       

      if nexec $HOST dsquery server

      then

      SERVER1_ID=`blcli Server getServerIdByName $HOST`

      RESULT=`blcli StaticServerGroup addServerToServerGroup $SERVER_GROUP1_ID $SERVER1_ID`

      else

      echo "$HOST is not DC"

      fi

       

      Rather than assign SERVER_GROUP1 a value in the script, I want to be able to pass it "Syracuse", or "London", or similar, as a parameter at the start of the job. Suggestions? TIA!