impersonation

Impersonate Domain User with Integrated Pipeline

时光总嘲笑我的痴心妄想 提交于 2019-11-27 17:32:30
This is a question that continues to haunt me... In an local Intranet environment, are we doomed to use "Classic" pipeline mode in our App Pool if we want to use Impersonate our Windows domain users, or is there a new way to declaratively "run as" them (so-to-speak)? My goal is to use Windows Authentication for local web applications on my Intranet so users can authenticate and run apps under their active directory account (principle). Every time I try this (Using the NetworkService identity of course), I get this error: Thanks! ;) I wrote a small app to display the current user's network

Run ExeCommand in customAction as Administrator mode in Wix Installer

 ̄綄美尐妖づ 提交于 2019-11-27 13:58:04
I am new to wix installer. I have developed a set-up using wix installer for my application and I need to execute a Custom Action to run a command in cmd.exe. In XP it works fine. But in Windows 8 & 7 the cmd prompt needs to be run as administrator. I have googled and found the keywords Elevated Privileges and impersonate might help me. <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"></Package> As you can see above, I used the InstallScope attribute set to perMachine, and I have used Impersonate="No" in the CustomAction element:

How to use LogonUser properly to impersonate domain user from workgroup client

﹥>﹥吖頭↗ 提交于 2019-11-27 11:13:13
ASP.NET: Impersonate against a domain on VMWare This question is what I am asking, but the answer does not provide details on how the _token is derived. It seems to only use WindowsIdentity.GetCurrent().Token so there's no impersonation happening. Can I impersonate a user on a different Active Directory domain in .NET? This next question has conflicting answers, with the accepted one bearing a comment "I'm beginning to suspect that my problem lies elsewhere." Not helpful. LogonUser works only for my domain This next question seems to imply it is not possible, but it deals with 2 domains so I

How to call LogonUser() to get a non-restricted full token inside a Windows Service with UAC enabled?

試著忘記壹切 提交于 2019-11-27 09:22:59
I am running a WindowsService on Windows Server 2012 and it needs to impersonate a domain admin user (who is also added to the local administrators group on the machine). UAC is enabled on the system and Calling LogonUser using the credentials with a LogonType of LOGON32_LOGON_INTERACTIVE, seems to return a restricted token instead of a full token. This is causing the administrative task i'm trying to do to fail. What is the right way to call LogonUser in this situation so that a full token is returned instead of an restricted token? PS: I came across a related question here How can I get

selenium web driver running as different user not getting profile/session of user

好久不见. 提交于 2019-11-27 08:14:58
问题 I have a strange situation where I have modified the selenium web driver code slightly to allow the driver service to be launched under a different user, changes to the code from github are: public void Start() { this.driverServiceProcess = new Process(); if (this.user != null) { this.driverServiceProcess.StartInfo.UserName = user.Name; this.driverServiceProcess.StartInfo.Password = user.Password; this.driverServiceProcess.StartInfo.Domain = user.Domain; } this.driverServiceProcess.StartInfo

LogonUser and delegation

别等时光非礼了梦想. 提交于 2019-11-27 07:09:01
问题 I'm using the LogonUser win32 api: token = LogonUser(...) WindowsIdentity newId = new WindowsIdentity(token); WindowsImpersonationContext impersonatedUser = newId.Impersonate(); However when calling a WCF service after this I'm not able to use the impersonated identity. I think this is because impersonatedUser.ImpersonationLevel equals Impersonation. Is this the reason? Is a level of ImpersonationLevel.Identification what I need? How to get such a level? 回答1: I don't know if this will work

Need to Impersonate user forAccessing Network resource, Asp.Net Account

人走茶凉 提交于 2019-11-27 06:23:18
问题 I need to access a network resource on which only a given Domain Account has access. I am using the LogonUser call, but get a "User does not have required priviliege" exception, as the web application is running with the asp.net account and it does not have adequate permissions to make this call. Is there a way to get around it? Changing the identity or permissions of the ASP.Net account is not an option as this is a production machine with many projects running. Is there a better way to

IIS7 Impersonation doesn't work to access TFS repository

╄→гoц情女王★ 提交于 2019-11-27 06:14:26
问题 I'm trying to build an ASP.NET page that adds a work item in TFS. I have enabled impersonation and Windows authentication: <authentication mode="Windows" /> <identity impersonate="true" password="" userName="" /> <customErrors mode="Off" /> In the page, I access TFS and try to add a work item: TfsTeamProjectCollection prjCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("xxx")); WorkItemStore store = prjCollection.GetService<WorkItemStore>(); ... However, it only

Impersonating user with Entity Framework

你说的曾经没有我的故事 提交于 2019-11-27 04:53:03
问题 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 access data. UPDATED: I'm looking for a way to abstract this code out so I don't have to have it in every repository function call. 回答1: Your EF connection string is

Impersonating a Windows user

不问归期 提交于 2019-11-27 04:33:33
I am using the code to impersonate a user account to get access to a file share. public class Impersonator : IDisposable { #region Public methods. // ------------------------------------------------------------------ /// <summary> /// Constructor. Starts the impersonation with the given credentials. /// Please note that the account that instantiates the Impersonator class /// needs to have the 'Act as part of operating system' privilege set. /// </summary> /// <param name="userName">The name of the user to act as.</param> /// <param name="domainName">The domain name of the user to act as.<