使用 ASP.NET 网络服务帐户访问网络文件夹
我的 ASP.NET MVC 2 应用程序在内置本地网络服务帐户下运行。我想为驻留在另一台计算机但位于同一域中的文件夹设置访问权限。我右键单击该文件夹以打开其属性表单,单击“安全”选项卡,然后按“添加”按钮,该按钮在位置字段中显示具有正确域名的“添加用户”表单。我使用以下语法引用该帐户:
<domain name>\<server name>$
因为我了解到 NETWORK SERVICE 帐户在连接到域中的其他计算机时使用计算机帐户。 但系统找不到该帐户,因此拒绝添加该帐户。如果没有域名,它会添加一个用户,但该用户似乎是本地用户,而不是 Web 服务器的 NETWORK SERVICE 帐户。我做错了什么?
顺便说一句,当我为与 Web 服务器不同的计算机的 sql 服务器创建登录名时,上述语法有效。
My ASP.NET MVC 2 application runs under built-in local NETWORK SERVICE account. I want to set up access permissions for the folder which resides in another computer, but in the same domain. I located that folder right-clicked to open its properties form, clicked to Security tab and pressed Add button which displayed Add user form with correct domain name in the location field. I referred to the account with following syntax:
<domain name>\<server name>$
because I learned that NETWORK SERVICE account uses machine account when connected to other computers in the domain.
However, the system couldn't find the account, so refuses to add the account. Without the domain name it adds a user, but that user seems to be local user, not web server's NETWORK SERVICE account. What am I doing wrong?
By the way, the above syntax worked when I created login for the sql server which is different computer from the web server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,我会回答我自己的问题。上面的语法 \$ 是正确的。添加用户权限时,只需确保在对象类型中选择计算机复选框即可。
OK, I will answer my own question. The above syntax \$ was correct. Just make sure to select computers checkbox in the object type, when adding user permissions.
我以前也遇到过同样的情况。我认为我无法将其与服务器/网络服务一起使用,但这可能值得一试。
找出网络服务用于访问网络资源的帐户。
。从这里您可以尝试将该帐户添加到文件夹的安全设置中。 (IIRC 我从来没有让它工作过)
或者,您可以确保该操作是在域用户的上下文中执行的。通过以下方法之一:
I have been in this same situation before. I don't think I got it to work with the Server/Network Service but this might be worth a try.
Figure out the account network service is using to access the network resource.
.. from here you can try and add the account to the security settings of the forlder. (IIRC I did'nt ever get this to work)
Alternatively you can ensure the action is performed under the context of a domain user. Either by: