Solved

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

Posted on 2014-07-21
5
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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