다른 사용자 (서비스 사용자는 아님)를 사용하여 C# 서비스에서 System.Diagnostics.Process
으로 djoin.exe
도구를 실행하려고합니다.C# 프로세스를 다른 사용자로 실행하지 못했습니다.
코드 -1073741502
을 반환합니다. 경우에
응용 프로그램 팝업 : djoin.exe - 응용 프로그램 오류 : 응용 프로그램이 제대로 (0xc0000142)를 시작 수 없습니다. 확인을 클릭하여 응용 프로그램을 닫습니다.
표준 오류 또는 표준 출력이 없습니다. 여기
내가 사용되는 프로세스의 구성입니다 :ProcessStartInfo startInfo = new ProcessStartInfo
{
Arguments = "/Provision /Domain domain.com /Machine PC12 /SaveFile NUL /printblob",
WorkingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
FileName = "djoin.exe"
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardInput = true,
RedirectStandardOutput = true,
CreateNoWindow =true,
Domain = "domain.com",
UserName = "other-user",
Password = "***"
};
if (username!=null)
{
startInfo.Domain = domain;
startInfo.UserName = username;
startInfo.Password = ToSecureString(password);
}
p = new Process { StartInfo = startInfo };
p.Start();
RUNAS
명령을 사용하여, 모든 것이 잘 작동합니다.
무엇이 문제입니까?
어떤 Windows 버전입니까? 그리고 앱에 높은 권한이 있습니까? –
Windows 2008 서버 R2. 그것은 하나의 서비스입니다. 승진 특권이란 무엇을 의미합니까? – Igal
해당 프로그램에서 사용하는 DLL 중 하나의 DllMain() 진입 점은 FALSE를 반환했습니다. 불행한 점은 응용 프로그램 이벤트 로그에 메시지를 남기지 않는 한 이유를 알 수 없다는 것입니다. 좋지 않은 확률은 찾을 수 있습니다. LoadUserProfile을 * true *로 설정해야하지만 꼭 조정할 수있는 노브가 충분하지 않습니다. 도움을 받으려면 앱 작성자 또는 소유자에게 문의하십시오. –