3 Replies Latest reply on Feb 12, 2013 1:08 PM by Gregor

    Set connection option "Override the default for current user"

    eignert

      Hi,

       

      I'm currently writing an application that allows me to configure my PI connection settings.
      I found all configuration information I needed but what I could not find is how to set the "Override the default for current user" option from the "Connection Options" dialog.

       

      Is there a way to do this using the PI-SDK?
      Or do I really have to set this flag in the registry?

       

       

       

      BR
      Thomas

        • Re: Set connection option "Override the default for current user"

          Hello Thomas,

           

          I understand you are about to develop a custom PISDKUtility. What's wrong with the one OSIsoft offers?

           
          myServer.DefaultUser = "Hugo"
          

           

            • Re: Set connection option "Override the default for current user"
              eignert

              Hi Gregor,

               

              I'm not developing a custom PISDKUtility but something that we will be using to automatically configure the installations of our users.

               

              I think my explanation was unclear. If you go to

               

              1. PI SDK Utility

               

              2. Connections menu

               

              3. Options...

               

              you will see that there is a group box "Default Server Settings". Inside this group box there is a checkbox with the caption "Override the default for current user (<username>)".

               

              Checking this box allows the user to have an individual user-account dependent setting of his default server that is needed in case multiple users are workin on the same client with different default servers.

               

              I'd like to activate this from my application (basically it's only adding a registy value to HKEY_CURRENT_USER\Software\PISystem\PI-SDK\1.0 / DWORD with name DEFSERVERBYUSER and value 1... But I'd like to do that using the PISDK and not by registry manipulation!

               

              Any ideas?

               

              BR

               

              Thomas

                • Re: Set connection option "Override the default for current user"

                  Hello Thomas,

                   

                  I doubt this information is available through PI SDK and I strongly recommend not directly accessing Windows Registry. You may be missing something like i.e. the additional string value "DefaultServer" that is storing the default server for a particular user when DEFSERVBYUSER is 1.

                   

                  The default username is used for explicit user login. We do not recommend this method at all because username and password are transferred unencrypted over the network.

                   

                  With your attempt to store the default username in dependency of the user connected you are using Windows security. Wouldn't it be a better approach to create mappings?