fmichail
asked on
How to make .net windows application run under a different account (like impersonation)
I am building an application where I will allow users to have do actions against files that they cannot do with their current permissions outside of the application. So I am thinking, is it possible to run the application under different serive account?. The application is a windows application (not web). Thanks
Give a look at the following Process.Start overload: http://msdn.microsoft.com/en-us/library/vstudio/sxf2saat(v=vs.100).aspx
Why not impersonation?
http://nujakcities.wordpress.com/2011/08/01/use-vb-net-to-impersonate-a-domain-user/
http://nujakcities.wordpress.com/2011/08/01/use-vb-net-to-impersonate-a-domain-user/
ASKER
Hi CodeCruiser
From your solution, I understand that whenever the application needs to execute any set of secured commands (that are not permissted to the logged in user) I use the LogonUser, however, the logged in normal user is still being the user of the application for the remaining functionalities after CloseHandle statement. Is that correct?
Can the command that are executed be as well against data in SQL server, or just file system?
Hi JamesBurger,
Thanks for the reply, however, I do not want to start the full application instance as a specific domain user, I need to open the application as the "Normal me", however, some parts of the application (that I do not have permissions to perform) will be still done by me, but using the impersonated user. Thanks
From your solution, I understand that whenever the application needs to execute any set of secured commands (that are not permissted to the logged in user) I use the LogonUser, however, the logged in normal user is still being the user of the application for the remaining functionalities after CloseHandle statement. Is that correct?
Can the command that are executed be as well against data in SQL server, or just file system?
Hi JamesBurger,
Thanks for the reply, however, I do not want to start the full application instance as a specific domain user, I need to open the application as the "Normal me", however, some parts of the application (that I do not have permissions to perform) will be still done by me, but using the impersonated user. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks CodeCruiser