在会话打开之前通过 UNC 路径访问 Windows 共享
我必须做一个在用户登录之前启动的 Windows 服务。这也意味着该服务必须有自己的用户名/密码。那么如何在不登录的情况下远程打开网络共享呢?
我位于 Windows 域中,目标是使用一些配置的凭据来访问我需要的远程文件。
你有主意吗?我只是找不到任何可以轻松访问服务器的
内容编辑:很抱歉我犯了一个错误,客户端计算机不在域中,服务器是:(
I've to do a windows service which starts before the user logon. It's also mean that this service has to do have its own username/password. So how can I open a network share remotly without being logged?
I'm in a windows domain, and the goal is to use some configured credentials to access the remote files I need.
Do you have an idea? I just can't find anything to access easily to the server
Edit: I'm sorry I made a mistake, the client computer isn't in the domain, the server is :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,您要做的是将服务设置为在指定用户(域)帐户下运行,并授予该用户对远程共享的访问权限。然后像访问其他共享一样访问该共享上的文件
Generally what you would do is set the service to run under a named user (domain) account and give that user access to the remote share. Then access the files on that share as you would any other i.e.
如果您无法以相关用户身份运行该服务,则可以通过 P/Invokes 代码来完成此操作。
使用用户名和密码连接到网络驱动器
If you can't run the service as the user in question, you can do it through code with P/Invokes.
Connect to network drive with user name and password