Interop.OpcAutomation.dll not able to connect to Remote Opc server. Error : Access Denied

1

I am trying to connect remote OPC server from client using C#. I got Interop.OpcAutomation.dll from OPC foundation and it worked very nicely with local opc server, but when comes to connect remote opc server it somehow shows Access denied (HRESULT: 0x80070005 (E_ACCESSDENIED)).

Here is code:

this._reqServer = new OPCServer();
this._reqServer.Connect("OPC.SimaticNET.1", "MachineName"); //Here it throws exception

So here what I already tried:

  1. Configured the permission in DCOM in MyComputerProperties and OPCEnum.
  2. I checked with third party clients such as OpcQuickClient and it can able to access the remote opc server from the same client, which forces me to come to the conclusion that configuration at server side is OK.

So anyone has tried to make some C# client which can access remote opc server, Please tell what more needs to done??

c#
.net
server
dcom
opc
asked on Stack Overflow Apr 14, 2015 by ThomasBecker • edited Apr 24, 2015 by John Saunders

3 Answers

1

Create a local user on your computer that has the same user name and password as the one on the server. Right click on visual studio and do a run as using that user.

answered on Stack Overflow Apr 24, 2015 by ambassallo
0

+1 for ambassallo's answer. I have two servers (Win Server 2016 servers) on two different connected networks. One server is on a domain and the other is stand-alone. I have an OPC-DA connection set up between them. The only way to get them to connect (after setting all DCOM, OPCEnum, etc and dropping the firewalls is to log into both machines as the same Windows user (local user on each server) and then connecting the client to the server.

answered on Stack Overflow Dec 11, 2018 by Mark Walker
0

My way is to grant access to the server to a local group, create a user on the server side and define this user as a member of the local group I created. After I create the same user in the client machine with the same password I use in the server side. Adjust ALL DCOM permissions, reboot and try tô connect. Don't forget, do not use NAT anywhere.

answered on Stack Overflow Feb 21, 2020 by Carlos Bomfim

User contributions licensed under CC BY-SA 3.0