windows-security

How to run a process as current user privilege from an admin process

女生的网名这么多〃 提交于 2019-11-28 09:38:18
问题 When a setup program(built by like Inno Setup) does launch a process, the process always be run as administrator privilege. -because setup program had been run as admin. I want to run the child process as current user's privilege. Is there a good way? 回答1: Although it is not considered best practice (or even good practice), it is possible to launch a medium IL process from a high/admin IL process: See this post on codeproject I can confirm that this code works on Vista 32 and 64-bit with and

How to apply Windows group policy using .NET?

陌路散爱 提交于 2019-11-28 07:04:36
Is it possible to apply (and remove) Windows group policy settings using .NET? I am working on an application that needs to temporarily put a machine into a restricted, kiosk-like state. One of the things I need to control is access to USB drives which I believe I can do through group policy. I'd like my app to set the policy when it starts and revert the change when it exits... is this something I can do through .NET framework calls? These are my primary requirements: Apply group policy settings when my console app is started. Identify when a user action is denied by the policy and log it.

Get a list of members of a WinNT group

霸气de小男生 提交于 2019-11-27 03:10:35
问题 There are a couple of questions similar to this on stack overflow but not quite the same. I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception. So far I started using the DirectoryEntry object with the WinNT:// provider. This is going ok but I'm stuck on how to get a list of members of a group

How to apply Windows group policy using .NET?

爱⌒轻易说出口 提交于 2019-11-27 01:42:30
问题 Is it possible to apply (and remove) Windows group policy settings using .NET? I am working on an application that needs to temporarily put a machine into a restricted, kiosk-like state. One of the things I need to control is access to USB drives which I believe I can do through group policy. I'd like my app to set the policy when it starts and revert the change when it exits... is this something I can do through .NET framework calls? These are my primary requirements: Apply group policy

How to get HttpClient to pass credentials along with the request?

笑着哭i 提交于 2019-11-26 01:29:38
问题 I have a web application (hosted in IIS) that talks to a Windows service. The Windows service is using the ASP.Net MVC Web API (self-hosted), and so can be communicated with over http using JSON. The web application is configured to do impersonation, the idea being that the user who makes the request to the web application should be the user that the web application uses to make the request to the service. The structure looks like this: (The user highlighted in red is the user being referred