Solved

How to make .net windows application run under a different account (like impersonation)

Posted on 2014-07-21
5
277 Views
Last Modified: 2014-07-22
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
0
Comment
Question by:fmichail
  • 2
  • 2
5 Comments
 
LVL 40
ID: 40210564
Give a look at the following Process.Start overload: http://msdn.microsoft.com/en-us/library/vstudio/sxf2saat(v=vs.100).aspx
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 40211509
0
 

Author Comment

by:fmichail
ID: 40211804
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
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 40211914
>Can the command that are executed be as well against data in SQL server, or just file system?

Every action performed while the application is impersonating will be performed by using the security context of the impersonated user so yes this includes SQL server if you are using windows authentication.
0
 

Author Closing Comment

by:fmichail
ID: 40212096
Thanks CodeCruiser
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb.net 2 43
Allow user to hide and show datagridview columns 4 25
VB.Net - TypeInitializer Error 25 25
VB.NET 1 21
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question