以另一个域上的特定用户身份写入目录 [英] Write to a Directory as a Specific User on a Different Domain
问题描述
有几项先决条件存在,很明显:
>- 计算机可以在域中看到对方,但需要进行身份验证
- 您知道登录信息
- 您要登录的用户名具有相应的写入权限
任何人都可以想法?
$ b $ p感谢,
凯尔
基本上,您需要获取用户标记的句柄(通常使用 LogonUser
),然后调用 Impersonate
。
还有几个项目(例如这一个 )使这个过程更容易一些。
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
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.
这篇关于以另一个域上的特定用户身份写入目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!