elevated-privileges

Request Windows Vista UAC elevation if path is protected?

For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request elevation mid-execution? Thanks. ...

Elevated Credentials for VB6

I need to get elevated credentials (to start a service) in a VB6 application, but only if the user needs to restart the service (I.e. I don't want to get elevated credentials whenever the application is started, only when the user selects restart). How can I do this in VB6? ...

Installing Tortoise SVN with elevated credentials

I'm trying to install TortoiseSVN (Ver: 1.6.1.16129) on Windows PC's where the user is not an administrator. The installer is an msi file and by default, there is no "Run As" option for it. I've tried both: msiexec /a "{PATH}\TortoiseSVN-1.6.1.16129-win32-svn-1.6.1.msi" and runas /user:username "msiexec /a {PATH}\TortoiseSVN-1.6.1....

SharePoint List access across Application Pools

I have a requirement where I need to be able to access a list which sits in Central Administration from an Application Page which sits on my Web Front End (WFE). The issue I have is that the Application Pool User for my WFE does not have access to the SharePoint_AdminContent database so I get access denied, they both have their own App P...

How can I copy a file as a "Standard User" in Vista (ie "An Administrative Choice Application") by prompting user for admin credentials?

I have what the UAC Development Guides refer to as a "Administrative Choice Application." If you're familiar with what this is skip to the next section. Background: I want to let a "Standard" user have the ability to select/deselect a Run On Startup option in the preferences for my application. Since my application is per machine (no...

UAC Application Manifest when you don't know runtime application name

I have a program that works fine if UAC is turned off. I want to be able to use a manifest to have it simply request elevation privileges when it launches. The instructions from MS say "The application manifest file should have the same name as the target executable file with a .manifest extension" and that's probably why I am not havi...

Launching a program in different creds or HKCU and installers

I have an installer that needs to a person to be an admin ( well at least drop stuff in the c:\program files\app dir ) I also need to create a bunch of entries in HKCU the thing is if if the installer is running as admin where will the HKCU go , presumably the admin. But I want the HKCU of the logged in user, so I would like to launch an...

SharePoint 2007 - RunWithElevatedPrivileges - Pitfalls of using this

I have a strong gut feeling that using SharePoint RunWithElevatedPrivileges should be avoided like the plague, but need to convince some others as to exactly why. Here's what I have. Spawns a new thread with elevated privileges Blocks other operations until the passed delegate returns Security problems (runs with a high level of privi...

How to update TaskbarItemInfo.ProgressValue when running the application with elevated privileges?

I tried to compile and run (as admin) the sample that demonstrate how to update the TaskbarItemInfo.ProgressValue but the progression is never updated. When I run the app with normal rights, everything works fine. Is there something that I'm missing here? Thanks, Jacques. ...

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...

How to programmatically gain root privileges ?

I am writing some software (in C++, for Linux/Mac OSX) which runs as a non-privileged user but needs root privileges at some point (to create a new virtual device). Running this program as root is not a option (mainly for security issues) and I need to know the identity (uid) of the "real" user. Is there a way to mimic the "sudo" comma...

Help with error creating SharePoint list (probably due to privilege issues)

I'm getting an error when trying to activate a webpart. It activates fine in one setup , but fails in a different one. Administrator in both. Seems like it fails because it's not able to create the list. The error is: Message: Value cannot be null. Stack Trace: at Microsoft.Sharepoint.SPRoleAssignment..ctor at ClientRequestHandler.C...

How can I programmatically edit the hosts file in Windows 7/Server 2008?

I'm writing a little WPF utility to manage entries in the hosts file for dev purposes. As you might know the hosts file is protected by the newer OSs (Win 7/2008/Vista). I've added a manifest to my application to set the requestedExecutionLevel to "requireAdministrator", as detailed here (using "the easy way") and in the related questio...

DuplicateHandle: need to OpenProcess, but the access is denied

Using windows hooks I send messages to my application, which is notified about Windows events by every application on the system. To execute marshal of the message parameters, I use shared memories. The external process calls DuplicateHandle, but for sharing the handle with my application instance, it shall call OpenProcess with PROCESS...

Elevating privileges doesn't work with UseShellExecute=false

I want to start a child process (indeed the same, console app) with elevated privileges but with hidden window. I do next: var info = new ProcessStartInfo(Assembly.GetEntryAssembly().Location) { UseShellExecute = true, // ! Verb = "runas", }; var process = new Process { StartInfo = info }; process.Start(); and this wor...

SharePoint PublishingWeb change under elevated security context fails, why?

I'm having trouble updating a SharePoint publishingWeb attribute under RunWithElevatedPrivileges. it fails with the exception "The security validation for this page is invalid" at this line : "pubWeb.IncludeInCurrentNavigation = false;". Below is the code i'm trying to run. Normally you can set AllowUnsafeUpdates = true, but publishingWe...

Restoring window started with "run as administrator"

Hi All, We have a customer requirement for our WPF application: - if child modal window is minimized -> than parent (main) window should be minimized as well. This is implemented by simple override in our base window class: protected override void OnStateChanged(EventArgs e) { base.OnStateChanged(e); if (WindowSt...

Start non-elevated process from elevated process

Hi My program running as an elevated process, and starting new processes with Process.Start(). For security reasons, I would like to run those new processes as non-elevated. How to do that? ...