locked
Running process as user not working RRS feed

  • Question

  • I'm trying to run a console application with a specific user from a MOSS webpart.
    The application creates excel files acording to some int parameter and then svae the files in the given directory.
    The application run and opens the excel application, but when trying to save it fails.
    The selected user is admin on the machine and yet.
    I tryed it through WCF service, win service and http web service -all did the same...
    THe console application it self work perfectly when call through command prompt or when debugging the service projects (not going through IIS).
    Impersonation is enabled for the IIS site and the application pool and both are using the required user.

    Here is the code I use to run this:

     string filePath = @"C:\DataFiles\FileCreator\ExcelFilesCreator.exe"; 
          System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(filePath, "1 c:\temp"); 
          info.UseShellExecute = false; 
          info.Domain = "domain"; 
          info.UserName = "user"; 
          string passwd = "password"; 
          unsafe 
          { 
            fixed (char* pwd = passwd) 
            { 
              System.Security.SecureString sc = new System.Security.SecureString(pwd, 8); 
              info.Password = sc; 
              info.CreateNoWindow = true; 
              info.RedirectStandardOutput = true; 
              System.Diagnostics.Process p = System.Diagnostics.Process.Start(info); 
            } 
          } 
    
    
    • Moved by Jim Groves Thursday, February 10, 2011 12:17 AM (From:Rights Management Services)
    Wednesday, January 26, 2011 12:36 PM

Answers

  • This forum is specifically intended to answer questions and answers pertaining to Rights Management Services in Windows Server. It's not a general security forum.

    You'll probably get a better answer if you post your question in the Windows 7 Security forum: http://social.technet.microsoft.com/Forums/en-US/w7itprosecurity/threads.


    Jim Groves Sr. Technical Writer, Server & Cloud Division, Microsoft
    • Marked as answer by Jim Groves Wednesday, February 2, 2011 7:15 PM
    Wednesday, February 2, 2011 7:15 PM