Client on non-admin user can't communicate using net.pipe with services

丶灬走出姿态 提交于 2019-11-30 16:40:23
Chris Dickson

I have read that you can't communicate using net.pipe between different users.

This isn't true in general. Here is a summary of what I think you are referring to:

If you are running on an operating system earlier than Windows Vista there is no problem: any process should be able to host a WCF net.pipe service accessible to any other local process.

If you are running on Windows Vista or later, a WCF net.pipe service will only be accessible to processes running in the same logon session (e.g. within the same interactive user's session) unless the process hosting the WCF service is running with the elevated privilege SeCreateGlobalPrivilege.

Windows Services run in their own logon session, and have the privilege SeCreateGlobalPrivilege, so self-hosted and IIS-hosted WCF net.pipe services are visible to processes in other logon sessions on the same machine.

In most scenarios I have come across where this is an issue, the workaround is to always host the WCF service in a Windows Service, using a duplex contract if necessary to reverse the client and server roles during an interaction session.

See also:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!