Solved

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

Posted on 2014-07-21
5
273 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now