impersonation

Using masterpages with selective impersonation

The masterpage of my site is using a control that reads data from a network share. To make this work on all pages I'm having to enable impersonation for the whole site. But what I want to do is only enable it for the pages that actually read/write to the share. Eg: <location path="SystemAdmin"> <system.web> <identity impersona...

How to use a logged in person's credentials to search Active Directory?

I have a web app (.NET 3.5) which is sending notifications by email to users. In order to do this, I search Active Directory to find each person's email. At the moment, I am hardcoding my own username and password like so in order to search AD: Dim entry As New DirectoryEntry("LDAP://companyad", "myUsername", "myPassword", Authenti...

After impersonation authentication screen keeps popping up in my ASP.NET Application

I'm working on a program that has to archive (zip and delete files and folders) on a server. The servers that hosts the application (ASP.NET MVC) and the server that holds the files are two different servers. When I run the application without impersonation and the default webconfiguration everything works fine. The credential of the pro...

Impersonation on Windows 2000 to Windows XP Leaves Connections Open

I'm running on a Windows 2000 Pro SP4 box (off domain) and trying to impersonate a local user on a Windows XP box (on domain). I'm using code very similar to the WindowsImpersonationContextFacade in the question posted here: http://stackoverflow.com/questions/879704/how-can-i-temporarily-impersonate-a-user-to-open-a-file. I am using im...

Temporarily granting elevated administrator privileges to ASP.NET code

We're trying to run a set of administrative tasks on the server via a web administration console. The console runs with impersonation as the currently logged-in user, and only administrators on the local machine are allowed to log in. Right now it works for most cases but we're having trouble when running under UAC. The first issue is...

Cannot execute a program. The command being executed "dqiitg0c.cmdline"

i have used impersonation in this application. whenever this error occurs i required to restart the IIS.. please guide me to solve this issue. Error: Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\T...

Windows Impersonation

Can any one please provide a clear example of how can I implement this in my C# code? ...

Impersonation - Access is denied

I am having trouble using impersonation to delete a PerformanceCounterCategory from an MVC website. I have a static class and when the application starts it checks whether or not a PerformanceCounterCategory exists, and if it contains the correct counters. If not, it deletes the category and creates it again with the required counters. ...

.NET Impersonate and file upload issues

I have a webpage that allows a user to upload a file to a network share. When I run the webpage locally (within VS 2008) and try to upload the file, it works! However, when I deploy the website to the webserver and try to upload the file through the webpage, it doesn't work! The error being returned to me on the webserver says "Access ...

impersonation problem

i am trying to implement impersonation in a project. this is the first time i am trying it this is what i have done. <identity impersonate="true" userName="NS1\name" password="secret" /> i am using the username and password provided as the plesk credantials. I don't know if my username format is correct. These are the details. Wi...

FileSystemWatcher running under impersonated user

I have an c# winform application that runs under a local account but needs to monitor folders on a domain. I am using slightly modified code from here to copy the files and that works fine. Can similar code be used with the FileSystemWatcher set up impersonation so I can monitor a folder on a domain? ...

What is Impersonation in ASP.net

Can you please explain impersonation in the view of non-technical users.Then please explain it in .NET world.Impersonation is quite evil or good?.Do we apply it for FORMS AUTHENTICATION? ...

ASP.NET access a folder as ASPNET even though impersonation is set

I have my ASP.NET web.config set with impersonation <identity impersonate="true" userName="domainName\userName" password="userPassword" /> I'm running some a method like IO.Directory.GetFiles(somePath) And monitoring the file system access with Process Monitor I keep getting all the access requests from the aspnet_wp.exe process to...

IIS, Impersonation and COM Interop Premission Denied

Hello we are in the throws of integrating a Document Management System with Dynamic CRM 4, have done similar things previously but in this instance we are having to reference a COM dll. We've configured the asp.net page (we are bringing the info in via a i-Frame in CRM), setting Impersonation = True in the Webconfig and ensured that Win...

Impersonation in ASP.NET MVC

I have an Action that needs to read a file from a secure location, so I have to use impersonation to read the file. This code WORKS: [AcceptVerbs(HttpVerbs.Get)] public ActionResult DirectDownload(Guid id) { if (Impersonator.ImpersonateValidUser()) { try { var path = "path to file"; if (!...

asp.net Impersonate User for network resource access

code: System.Security.Principal.WindowsImpersonationContext impersonationContext; impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate(); //access network resources. impersonationContext.Undo(); web.config: <authentication mode="Windows"> </authentication> <identity impersonate="t...

dnscmd remote call from ASP.Net (Impersonation, delegation and all this funny stuff)

Hi! I've always suposed that I was facing a permission problem, but I'm not sure now. We are trying to manage our Microsoft DNS Server via ASP.NET in different servers with the "dos" command "dnscmd". How? It may seem easy with: System.Diagnostics.Process runner = new System.Diagnostics.Process(); runner.StartInfo.UseShellExecute = fa...

ASP.NET PowerShell Impersonation

I have developed an ASP.NET MVC Web Application to execute PowerShell scripts. I am using the VS web server and can execute scripts fine. However, a requirement is that users are able to execute scripts against AD to perform actions that their own user accounts are not allowed to do. Therefore I am using impersonation to switch the id...

Accessing Mapped Drives When Impersonating in ASP.NET

Short Version: Can anyone say whether it's possible or not to use impersonation in ASP.NET to access mapped drives? Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined fo...

How to Impersonate a user for a file copy over the network when dns or netbios is not available

I have ComputerA on DomainA running as userA needing to copy a very large file to ComputerB on WorkgroupB which has the ip of 192.168.10.2 to a windows share that only userB has write access to. There is no netbios or dns resolving so the computer must be refrenced by IP I first I tried AppDomain.CurrentDomain.SetPrincipalPolicy(Syste...