7 Replies Latest reply on Apr 27, 2012 7:44 AM by Bill Robinson

    Unable to set the role in NSH script

    Mickael Leib


      On my Appserver, from a command prompt I can run the following:
               blcli -r BLAdmins -v Default Server listAllServers

      The command run without prompting me for anything and return the list of servers.


      I tried to put the command in a NSH script and each time it asks me for the role (after choosing the role the command executes successfully). I tried to add the blcred cred -acquire command and even replace the whole blcli line with similar "blcli_setoption roleName BLAdmins", "blcli_execute Server listAllServers", etc... without success as it always asks me for the role selection.


      I also an the same command in a NSH shell and again it prompted me for the Role (after keying the role number, the command executes successfully).


      Is there anything I need to set up/change for this command to execute with the role selection?




        • 1. Re: Unable to set the role in NSH script
          Bill Robinson

          Is your nsh client configured to use a nsh proxy?


          I think it is nsh prompting you for the role, not the blcli.

          • 2. Unable to set the role in NSH script

            It is NSH asking for the role, becuase of NSH proxy.

            • 3. Unable to set the role in NSH script
              Mickael Leib

              Hi all,

              Yes I also wonder if my setup is configured properly to use the NSH PROXY... The secure file on the appserver (which is also the client from where I run the script) is set with the following line:




              Is that enough to tell the client to use NSH PROXY?




              • 4. Unable to set the role in NSH script

                Yes, I think so, the appserver_protocol=ssoproxy

                However it is also recommended to provide authentication profile and profile file xml for it to work on NSH clients.


                In your case, appserver_protocol=ssoproxy -> this is what is causing it

                • 5. Unable to set the role in NSH script
                  Bill Robinson

                  if this is the appserver i would leave it as is and just set the BL_AUTH_PROFILE and BL_AUTH_PROFILE_FILE env vars (or whatever they are) if you need to run at the cmd line.

                  • 6. Unable to set the role in NSH script
                    Mickael Leib

                    I tried to set the BL_AUTH_PROFILE_NAME and BL_AUTH_PROFILES_FILE variables and it works. I will check and update all my appserver accordingly.


                    Thanks for your help and advice.



                    U mentionned it will be better to set the environment variable instead of changing the secure file on the appserver. Does it mean that the Env variables will impact the server as a whole (for all profiles and for NSH initiated from DOS command prompt, "NSH Here" or NSH Console) while the secure will only impact a certain profile?




                    • 7. Unable to set the role in NSH script
                      Bill Robinson

                      those two env vars are used when nsh is configured to talk to a nsh proxy.  i believe you can also set BL_RBAC_ROLE and that will avoid the prompt. 


                      on the appserver you only need the 'appserver_protocl=ssoproxy'.  you shouldn't be using your appserver as a gui machine so there shouldn't be an authprofile on there anyway .  i think the appserver will still startup correctly if you put in the profile but it's not needed.


                      actually, since 8.0.10 and 8.1.02 you don't need to set the profile in the secure file on the client either as long as you only use NSH Here and don't launch nsh from the commandline.  the gui now passes down the profile/creds to the nsh windows from custom commands.  so you can connect to different nsh proxies w/o having to flip the secure file around.