3 Replies Latest reply on Nov 7, 2017 9:53 PM by PeterHuang

    Remote Connection to PI server on Windows Work station

    PeterHuang

      I would like to access the PI server from another machine in a work station environment. We have the following setup

       

      VM 1:

      Work station Machine

      It has the username “TestUser” with password “TestPassword”

      Contain the DeltaV Advanced Continuous Historian ( This historian is based on  OSI PI)

       

      VM 2:

      Work station machine

      It has the username “TestUser” with password “TestPassword”

      Contain a test program to access the PI Server on VM1.

       

      Both VMs are hosted by my workstation and they are in the same subnet.

       

      The test program has the following code

       

      PIServers piServers = new PIServers();

      piServer = piServers[VM1];

             piServer.Connect(); <- throw the exception.

       

      What I’m getting is RemoteConnection exception with the following message and stack

       

      Cannot connect to the PI Data Archive. Windows authentication trial failed because insufficient privilege to access the PI Data Archive. Trust authentication trial failed because insufficient privilege to access the PI Data Archive.

       

       

      at OSIsoft.AF.PI.PIServer.CheckFailedServer(PIServerError& serverError)

      at OSIsoft.AF.PI.PIServer.AutoConnect(Boolean allowDirectConnect, Boolean force)

      at OSIsoft.AF.PI.PIServer.Connect(Boolean force)

      at TestAFSDK.GetHistoryData.Connect(String piServername) in d:\ptest\TestAFSDK\TestAFSDK\GetHistoryData.cs:line 39

      at TestAFSDK.Program.Main(String[] args) in d:\ptest\TestAFSDK\TestAFSDK\Program.cs:line 18

       

      I had also hardcoded the credential with C# NetworkCredentail object using   “VM1\TestUser” and “TestPassword” and pass into the Connect Call.  This fail with a different exception

       

      at OSIsoft.AF.PI.PIException.ConvertAndThrowException(PIServer piServer, Exception ex, String message)

      at OSIsoft.AF.PI.PIServer.RemoteConnect(AFConnectionPreference preference, NetworkCredential credential, PIAuthenticationMode authenticationMode)

      at OSIsoft.AF.PI.PIServer.InternalConnect(Int32 numRetries, IWin32Window owner, AFConnectionPreference preference, NetworkCredential credential, PIAuthenticationMode authenticationMode, Boolean checkConnectingAsSameUser)

      at OSIsoft.AF.PI.PIServer.Connect(NetworkCredential credential, AFConnectionPreference preference, PIAuthenticationMode authenticationMode)

      at OSIsoft.AF.PI.PIServer.Connect(NetworkCredential credential)

       

      When I run the test program locally on VM2 using

       

      piServer = new PIServers().DefaultPIServer;

      piServer.Connect();

       

      Everything worked fine as I can use objects such as PIPoint to perform operation that I needed. So this is a remote access credential issue with AF SDK.  Please advise if the code look fine for remote PI server connection. If not, please advise on the changes. If the code is correct for remote server access, please advise if work station environment require some additional setup. As both machine has the same user name and password, please advise on the necessary setup needed to allow for one username/password in  the client machine to access the same username/password on the PI server machine. Thanks