impersonation

Impersonation and Delegation

I am using impersonation is used to access file on UNC share as below. var ctx = ((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate(); string level = WindowsIdentity.GetCurrent().ImpersonationLevel); On two Windows 2003 servers using IIS6, I am getting different impersonation levels: Delegation on one server and Impe...

Want my WCF service to run under the administrator account

Hi, How can I configure my WCF service to run under the administrator account? (this is not for production, just testing). Is it simply a web.config tweak? IIS 7 hosted WCF service. ...

what user account does my IIS hosted wcf service run under?

Hi, what user account does my .net wcf service run under when I am hosting it in iis 7? Is it the IUSR_machine account? What is the easiest way for me to run under a different account? (just for this service, don't want other things hosted in my IIS to be effected). ...

Impersonating users to access hives - various methods, what are the practical issues?

I am designing a Service to run under LocalSystem account on Win2000, XP and Vista. It will need access to users registry hives, sometimes for extended periods of time, both when the users are logged-in, and also, when they are not logged-in (IF the profile is local. If the profile is Roaming and not loaded, I will not attempt to load it...

What is the difference: LoadUserProfile -vs- RegOpenCurrentUser

These two APIs are very similar but it is unclear what the differences are and when each should be used (Except that LoadUserProfile is specified for use with CreateProcessAsUser which I am not using. I am simply impersonating for hive accesss). LoadUserProfile http://msdn.microsoft.com/en-us/library/bb762281(VS.85).aspx RegOpenCurrent...

Run new process as different user in vb.net

I'm currently using a homegrown method to run a process as a different user in Vista, and I can't escape the feeling that's it hack-ish and less than ideal (in addition to the fact that it craps out UAC, crashing my app with a security exception, and forcing me to disable UAC altogether). My process consists of two projects (so two EXE f...

Error when impersonating a user in .NET in a scheduled task

I have a .NET console app running on Windows Server 2003, as a scheduled task. This uses the Process class to run another little console app, but it uses Process.StartInfo.Username to impersonate a user to run it as. If the account that is impersonated in the scheduled task in an Administrator, then it works perfectly, but if not then ...

ASP.NET - temporarily impersonate the app pool service ID when default it to impersonate the user?

I have to call some code in a SharePoint site that runs under the same service ID that the web application is running under. By default, SharePoint impersonates the user viewing the web page, and the users don't have the necessary permissions. What is the best way to run some code using the web application's service ID, then revert bac...

Problem using OLEDB driver in SQL Server CLR procedure

Hi, we are trying to create C# CLR Stored Procedure on a SQL Server 2005 machine. The C# code connects to an external datasource via an OLEDB driver to get a datatable. It has been tested on a separate console application, and it runs without problems. (The OLEDEB Driver is a proprietary driver connecting to a proprietary DB...) On SQL...

Can ASP.NET Impersonate a user to Delete a Performance Counter Category?

I believe that I have successfully impersonated my own user account while running an ASP.NET page on my local machine. Using the method described here, I have successfully changed the WindowsIdentity.GetCurrent().Name from ASPNET to my domain account. I can successfully write to a file on the file system that ONLY my account has perm...

Impersonation and Delegation in ASP.NET

I'm having problems accessing a text file on a remote server with ASP.NET. The ASP.NET 1.1 application is running on Server 2003 using Impersonation with the requester's Windows Credentials. The client, webserver, and remote server are all on the same domain, and the user has permission to access the text file. The user can open the t...

Windows Impersonation from C#

How can a C# program running as LocalSystem impersonate the login identity of another user temporarily? Roughly speaking I have a Windows Service that I'd like to run as LocalSystem but at times impersonate user XYZ (when connecting to a db using windows integrated security). Most important of all: Is there a way to do this without kno...

What allows a Windows authentication username to work (flow) between 2 servers?

Typical ISP setup. One server is the web server, another is the DB SQL server. There is a local administrator account, let's say XYZ, created on both machines. So when I log in remotely, I am either WebServer\XYZ or DBServer\XYZ, depending where I log in. Now, when I login to SQL Server SSMS on DBServer using Windows Authentication, ...

Why am I only allowed to access this zip file in Debug mode?

I'm having a problem that doesn't make a lot of sense to me. I have an ASP.NET application that runs perfectly in Debug mode, but throws Access Denied errors when running normally. I've given the ASPNET account and the account the application impersonates Full Control rights on the files the webapp is calling (using the Process object). ...

Is it possible to get a valid token from a remote computer?

Is it possible to impersonate a u/p on a remote computer? Ideally I would like to call the ImpersonateLoggedOnUser with a token I would obtain from logging into a remote computer. I know I can make a valid connection using wnet functions, but just don't know about impersonation. ...

Elevate impersonated credentials to app pool credentials in IIS

I am using impersonation in an application in IIS. I need to write a file to the file system, but don't want to use the impersonated user's credentials in this one case. I need to use the credentials of the app pool. How do I temporarially elevate a worker process' credentials from impersonated credentials to the app pool's credentials?...

ADSI / IIS management and ASP.NET impersonation

I'm in the process of writing a small web app that would allow me to manage several IIS installations on different servers on our network. We have no domain controller. I have written a small impersonation controller that uses the win32 api and its LogonUser method. I then use System.DirectoryServices and the IIS ADSI provider to create...

Problem Connecting to WCF Service on a Server

I have set up a WCF service on a server which lives in its own Workgroup. I've tried to make a TCP/IP connection to it from a client that lives on the corporate domain. When I try to open a connection, I get a SecurityNegotiationException with the message: "A remote side security requirement was not fulfilled during authentica...

Add elements to an an announcements list for a specific user

I have a customer request to create a number of announcements based on some data from another database. Most of it seems easy enough but the new elements should be created by the user (login) specified in the input data. I was planning to add the announcements using the list web services but I sure would like to avoid using impersonatio...

DLL References fail with "Access Denied" when using Impersonation for a NON-Local-Admin windows user

We have a service using WCF and Impersonation. A user can log in to the client application with credentials that are part of an Active Directory system. The users login is impersonated service side. This works fine when the user who logged in is setup as a Local Admin on their host machine. But a problem occurs when they are a non-...