Impersonation is a process whereby an application assumes another identity or security context during execution.
Questions tagged [impersonation]
1522 questions
4
votes
1 answer
How to connect to SQL Server with a different windows account
I have a C# windows application from which I need to connect to a SQL Server database and access the tables, with a different windows account.(Other than the logged in account)
What is the best approach for this.

KhanS
- 1,167
- 2
- 12
- 27
4
votes
1 answer
Is it possible to assign roles using the Exchange web services in c#?
Is it possible to assign roles using the Exchange web services in c#? Like you programatically automate of adding the role ApplicationImpersonation and assign the role to the users in Office 365 Exchange?

mak
- 350
- 2
- 4
- 11
4
votes
3 answers
LogonUser failed with error code: 1326
Please can any one help me with this? I was trying to login to portal.microsoftonline.com with the credentials needed but it gets me that error. Is my URL is wrong or what? Because i am trying to impersonate and give a role to a user. Thank you and…

mak
- 350
- 2
- 4
- 11
4
votes
1 answer
Impersonation of a domain account outside of a domain
I have a click once application that uses Windows Auth to authenticate against WCF services. However I am trying to allow users to run this application at home via a VPN connection. The main issue here is that the DefaultNetworkCredentials aren't…

Aron
- 15,464
- 3
- 31
- 64
4
votes
1 answer
C# accessing DirectoryEntry via impersonation will throw a catastrophic exception for the first time only
I am impersonating a user using this c# code:
SafeTokenHandle logon_token = null;
SafeTokenHandle duplicate_token = null;
const int LOGON32_PROVIDER_DEFAULT = 0;
const int LOGON32_LOGON_INTERACTIVE = 2;
const int…

Yacoub Massad
- 27,509
- 2
- 36
- 62
4
votes
1 answer
CreateProcessAsUser: Service gets "5: Access Denied" trying to access network share
I use CreateProcessAsUser from a Windows Service in order to launch an application for the current active user. So far it works great with applications on a local drive.
But if the executable exists on a network share, the service generates 5:…

Joe
- 2,496
- 1
- 22
- 30
4
votes
2 answers
How to impersonate another user for a DCOM connection in C#?
I am trying to connect to a DCOM object on a remote machine which is logged in as a different user from a C# application. I have gotten my code working to connect to the same DCOM object while it is running on the same computer, like so:
MyDCOMType…

Mason
- 703
- 6
- 20
4
votes
2 answers
Start/Stop service from an ASP . NET page
I implemented a web page (ASP .NET, VB) to start/stop a Windows service.
I used impersonification, as described here: http://support.microsoft.com/kb/306158
Everything it's ok when the page reads the service's status:
_domain =…

Matte
- 195
- 1
- 10
4
votes
1 answer
WCF Parallel Impersonation
I have a WCF service with "ImpersonationOption.Required". The impersonation does not seem to flow through when using parallelism. For example:
Parallel.ForEach(items => results.Add(SystemUtil.WindowsUser.Name)
Will return a number with the…

user1582843
- 75
- 5
4
votes
1 answer
Copying a file to a network share which I don't have access to
This is an extension of this question
I am trying to copy a file from my local user's temp folder to a remote file share.
I do not have access to the remote file share, so I have to impersonate a user who does.
Now, I can successfully read a file…

Simon
- 9,197
- 13
- 72
- 115
4
votes
2 answers
providing domain/user credentials to webview control
Does anyone know how to provide credentials to a WebView control (or even better - run a Windows 8 Metro style application / WinRT app in the context of a specific domain user?) I've tried following the HttpClient + WebView approach as listed here…

Henry C
- 4,781
- 4
- 43
- 83
3
votes
2 answers
Redirect after user switching (impersonating) in Symfony 2
I searched everywhere but it seems impossible thing to do.
I was able to catch SwitchEvent coming from SwitchEventListener and get both impersonator and target user objects (one being impersonated as) but I would really like, based on target user…

Jovan Perovic
- 19,846
- 5
- 44
- 85
3
votes
1 answer
How to impersonate using silverlight client object model?
I am developing silverlight web part for sharepoint 2010 in C#.In silverlight client object model the sharepoint 2010 takes the current user credential by using the following statement
ClientContext clientContext = ClientContext.Current;
Now I…

Shailesh Jaiswal
- 3,606
- 13
- 73
- 124
3
votes
1 answer
IIS still accessing resources via pool identity, not impersonated user
I'm at my whitt's end!
On Server 2003, I have an INTRANET app configured to use BASIC AUTHENTICATION and an app pool with a dedicated account.
In web.config I'm specifying
In a…

Todd Beaulieu
- 627
- 6
- 7
3
votes
3 answers
Is it possible to duplicate the following credential process in VB.NET?
Solution (kinda):
Turns out this impersonation with .NET's security only allows application-level access. Since the COM object is at the system level, the impersonated user still cannot instantiate it. I figured this out by right-clicking the…

Anders
- 12,088
- 34
- 98
- 146