AnsweredAssumed Answered

How to set a username / password for a PI SDK connection?

Question asked by andrew_Inwood on Aug 10, 2016
Latest reply on Aug 10, 2016 by gregor

I thought that this would be an easy thing to find, but I haven been unable to find it!

 

We have some applications that use the PI SDK to retrieve data, and in some cases, write to the PI Database.  Our current method to do this is simply to create a server connection to the default server.  Windows credentials are implicitly used, and everything works fine:

 

using PI = PISDK.PISDK;
namespace PI_Handler
{
    private Server m_oServer = null;                //PI Server reference
    
    public class PI_Interface
    {
        public PI_Interface()
        {
            m_oServer = oPI.Servers.DefaultServer;
        }
    }
}

 

We want to upgrade our security so that the default users won't have admin privileges, and therefore won't be able to have write access to the PI database.  For apps to run on their machines that do write to the database, the app will need to create a connection that has administrator privileges.  Unfortunately, I can't find a way to create a connection using a specified username & password.  Can someone help please?

 

Thanks,

 

 

Andrew

Outcomes