[英]Run program (exe) as different user (service account), access to network share
From couple of days I'm strugling with problem. 从几天开始,我一直在努力解决问题。 I must write a small application which runs another app with different credentials (service account).
我必须编写一个小型应用程序,该应用程序可以使用不同的凭据(服务帐户)运行另一个应用程序。 Everything is easy but on the server we have a policy that denies log on service accounts and the policy can't be removed.
一切都很容易,但是在服务器上,我们有一个拒绝登录服务帐户的策略,并且该策略无法删除。
I tried: Process class, Impersonating mechanism, CreateProcessWithLogonW, CreateProcessAsUser 我试过:流程类,模拟机制,CreateProcessWithLogonW,CreateProcessAsUser
with different configurations. 具有不同的配置。 Once I managed to log on with service account I have error network path not found.
一旦成功使用服务帐户登录,我将找不到错误的网络路径。
CreateProcessWithLogonW works perfectly on local machine but not on the server where this policy is. CreateProcessWithLogonW可以在本地计算机上完美运行,但不能在该策略所在的服务器上运行。 Maybe I'm missing some certain configuration.
也许我缺少某些配置。
I've got solution. 我有解决办法。 This was configuration problem.
这是配置问题。 Server didn't have proper DNS entries for DFS (Distributed File System).
服务器没有用于DFS(分布式文件系统)的正确DNS条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.