How can I give a windows service access on a remote machine in case of Workgroup?

故事扮演 提交于 2019-12-04 16:27:54

The simplest way is to mirror the username and password on both machines, creating the same account on both machines, then run your service under that account. As you're in a workgroup and not a domain the remote login will work, but once you're in a domain that no longer works.

You cannot use any of the built in service accounts (Network Service, Local Service, Local System for this)

You can run it under user account that has access privileges on remote machine.

Or you can use impersonation when accessing remote machine. For impersonation you will need username and password that has access to remote machine. Look here for some code on impersonating in .net http://blogs.msdn.com/shawnfa/archive/2005/03/22/400749.aspx

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