impersonation

Unable to stop .NET windows service remotely

Hi I have developed an app in C# .NET 2005. It is used to Start and Stop .NET windows services remotely. If i run this app in my local system, it works fine. It stops the windows services in other system. The same application i put in Server and tried to stop services in another server. It is failing. The app is able to ping the other s...

ASP.Net Membership Provider. Impersonation

I have a custom membership/roles provider, due to the nature of the project it will require Admins to login as users while assisting them with querys. Now, Its easy to re-log the admin in with the selected membership account, however this meens that the Admin will effectivly be logged out. I'm looking for a way to allow Admins to impers...

initiating a program that has more user privilages in restricted user

Hi All! I have users with limited access granted to one of my hard drives. Those users are not given the permittion to delete the files in that drive. but I have a application that should allow those users to delete files in the above mentioned drive. 1) How can I do this? 2) When a low priviliaged user loged to my application, can I ...

How to impersonate another Windows user, when using Windows authentication?

I have an ASP.NET application where only users authenticated by Windows (i.e. logged on user) have access to most pages. Now, my client wants to be able to 'log on' through this app, with a custom login dialogue/page. Is Authentication the way to achieve this, and how do I go about it? ...

How can I run a command line process that requires AD authentication from a .NET web service?

This is almost identical to this question asked by another user, and is the sequel to a question I asked previously. Basically, my company recently bought Tidal Scheduler. We need to launch jobs ad hoc from other process, e.g.: BizTalk, .NET web apps, etc. Our plan was to wrap a .net web service around the C++ API. That is apparently go...

Problem when changing context (impersonation) and using a server link in SQL Server 2005

I get a strange behaviour when I combine impersonation with database links in SQL Server 2005. First, I connect to a database server using simple SQL Server Authentication with Login 'John'. On this server, a server link remote_sqlserver is defined. I already have SELECT privileges for mydb in this server. When I simply query a table on ...

How do I get a WSE 3.0 web service to impersonate my client's identity?

I have a WSE 3.0 based web service running in Windows Server 2003 under IIS 6.0. I want the web service process to impersonate the client user that sends the web service request, however the service is not impersonating the client. The web application has its own app pool, which is currently set to run under the Network Service identity...

ASP.NET impersonation - how to determine if the current user is impersonating someone?

I am using FormsAuthentication.SetAuthCookie("username", true ); so that a helpdesk person could impersonate another person's ans go in and see what the account looks like. I as wondering if there is a way my code can determine that this session is running through impersonation (so that I can block a couple of pages and flash a sign ...

Impersonating a Remote object

I have a web application in which web server acts as a remoting client. Here I am creating CAOs using SAO. I want to impersonate the client who logs into the web application on Remoting Server. While I am able to impersonate the client objects created by SAO object factory, but using these objects method calls are not getting impersonate...

Impersonation: ASP.Net MVC Controller Action vs. Web Forms

Is there a difference with impersonation between an ASP.Net MVC controller actions vs. an ASP.Net Web Form? Using the exact same code within the same web project, I am able to successfully impersonate the Windows user when connecting to SQL Server from a Web Form but not from the Controller Action. Here is the code sample I am testing ...

asp.net impersonation setup

My web app is set to use Windows Authentication and Impersonation is set to true. <authentication mode="Windows"/> <identity impersonate="true"/> When I run it on my local machine (IIS6), I access Active directory with my current login. WindowsIdentity curIdentity = WindowsIdentity.GetCurrent(); WindowsPrincipal myPrincipal = ne...

Can I change execution context in a SP from OWNER to CALLER? [SQL Server 2005]

Is it possible to change execution context to CALLER in a stored procedure, which is created with EXECUTE AS OWNER? Here is what I mean with a simplified example: There are several logins and databases in a server instance. Assume that everybody has a table named *current_work* in his own database, but nobody can access to no other's ta...

Impersonating user with Entity Framework

So we have our web app up and going with entity framework. What we'd like to do is impersonate the current user when we're accessing the DB. We're not interested in setting impersonation up in our web config. Ideally using something like this: http://geekswithblogs.net/jkurtz/archive/2007/08/27/114992.aspx when we're about to acces...

Windows Impersonation failed

I am using following code to implement impersonation for the particular windows account,which is failing.Please help. using System.Security.Principal; using System.Runtime.InteropServices; public partial class Source_AddNewProduct : System.Web.UI.Page { [DllImport("advapi32.dll", SetLastError = true)] static extern bool LogonUser( ...

Which account is used when a user navigates to a ASP.NET website?

When a user browses to a ASP.NET website, is the user impersonating the ASPNET account or the account specified in IIS->Directory Security->Account used for anonymous access (EX: IUSR_XXX) My website writes files to the disk and I was wondering which of these accounts need write access to the folder? Also, can someone explain how the im...

Validate NT User via SQL CLR

I need to be able to validate a given username and password against Active Directory and return whether that user exists. My setup is that I have two web servers in a DMZ, and then a SQL Server in the LAN. The sales people have a admin panel that is on the web servers. When they login to the admin panel, I want it to run a stored proc...

ImpersonateLoggedOnUser causes lengthy delays

I need to permanently change the identity of the user while an application is running. The application connects to multiple external devices. The connection to these external devices cannot be interrupted during a shift change (i.e., the current user is replaced by another user). Also, the content displayed on the secondary video canno...

Compiling Microsoft's LoginAdmin.dll code without Visual Studio

I'm trying to use some impersonation functions in a classic ASP page. I found a MS KB article at http://support.microsoft.com/kb/248187 which explains how to do this, but it requires compiling a DLL. Unfortunately, they expect the developer to have Visual Studio, which I do not have access to (nor do I want to). Could anyone tell me how ...

Access web.config settings using WCF Impersonation with net.tcp binding

I'm trying to use impersonation with my WCF service (using net.tcp binding) hosted in IIS 7. I've got to the point where it's impersonating the client but whenever I try to access any configuration settings in the web.config using Settings.Default.SomeSetting it throws a SettingsPropertyNotFoundException. Is this because IIS is running u...

Impersonate Problem

Hi , We are running a application which will write files into another machine using Impersonate through WebService .But we are not able to write those files.We dont know how to grant permission to access the folder. Help me. ...