作为不同域上的特定用户写入目录

发布于 2024-08-08 07:56:06 字数 236 浏览 2 评论 0原文

我想知道,如何将文件(例如,从计划任务中的控制台应用程序)写入不同域中的另一台计算机?如何设置用户名和密码,例如使用“登录到...”对话框进行身份验证?

显然,存在几个先决条件:

  • 计算机可以跨域相互查看,但是它们需要进行身份验证
  • 您知道登录详细信息
  • 您登录时使用的用户名具有适当的写入权限

有人知道吗?

谢谢,

凯尔

I am wondering, how would one write a file (say for instance, from a Console Application in a scheduled task) to another computer on a different domain? How would one set the Username and Password, such as with the "Log on to..." dialog to authenticate?

Couple of prerequisites exist, obviously:

  • The machines can see each other across the domains, however they need to authenticate
  • You know the login details
  • The username you would log in with has the appropriate permissions to write

Anyone have any idea?

Thanks,

Kyle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖心男生 2024-08-15 07:56:06

这里的方法是使用 冒充。请查看此处,了解简单的操作方法。

本质上,您需要获取用户令牌的句柄(通常使用 LogonUser),然后调用 冒充

还有几个项目(例如 这个)可以使该过程稍微简单一些更轻松。

The approach here is to use Impersonation. Have a look here for a straightforward how-to.

Essentially, you need to obtain a handle to the user token (usually using LogonUser), and then call Impersonate.

There are also several projects (eg this one) to make the process a little easier.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文