S
Sorin Dolha [MCSD .NET]
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another user to gain the required rights for execution (the external process needs to create a mailbox in Exchange, so it needs to be run as an Exchange Full Administrator-powered user).
For the moment, I have tries using the Start() static method of the Process class (from .NET Framework) to start the new process. However, this way, I cannot impersonate the new process as another user. Therefore I tried to impersonate the execution of the C# web page code by using <identity impersonate="true" userName="..."... /> in the Web.config configuration file of the web site. However, the new process still starts as ASPNET.
To test and dig more, I have tried to configure the <processModel> in my machine.config to impersonate the whole execution of the ASP .NET processes, but the new process (and also aspnet_wp.exe) are still running as the ASPNET (machine) user (that's what TaskManager shows in the Processes tab).
So, I couldn't solve the problem yet and it looks like I will need to dig some more about this, but before doing so, I wanted to ask if anyone else from here has already had this problem, and what was the resolution or work-around he or she found. Any other advice would be very appreciated.
Thank you very much,
For the moment, I have tries using the Start() static method of the Process class (from .NET Framework) to start the new process. However, this way, I cannot impersonate the new process as another user. Therefore I tried to impersonate the execution of the C# web page code by using <identity impersonate="true" userName="..."... /> in the Web.config configuration file of the web site. However, the new process still starts as ASPNET.
To test and dig more, I have tried to configure the <processModel> in my machine.config to impersonate the whole execution of the ASP .NET processes, but the new process (and also aspnet_wp.exe) are still running as the ASPNET (machine) user (that's what TaskManager shows in the Processes tab).
So, I couldn't solve the problem yet and it looks like I will need to dig some more about this, but before doing so, I wanted to ask if anyone else from here has already had this problem, and what was the resolution or work-around he or she found. Any other advice would be very appreciated.
Thank you very much,