elevated-privileges

Process Start as domain administrator from user started process with UAC activated in domain network

拜拜、爱过 提交于 2020-01-15 03:07:54
问题 I am trying to do something that, now after much banging my head against the screen, am not sure it can be done. The scenario is as follows: a windows network with a domain controller where the normal users of the PC's don't have administrative privileges. A program that, when it finds an update (MSI) in a share of the network (UNC path), will run the update. Because the user cannot do installations. The update must be run with some other user with admin rights. The theory is sound but: it

Process Start as domain administrator from user started process with UAC activated in domain network

杀马特。学长 韩版系。学妹 提交于 2020-01-15 03:06:53
问题 I am trying to do something that, now after much banging my head against the screen, am not sure it can be done. The scenario is as follows: a windows network with a domain controller where the normal users of the PC's don't have administrative privileges. A program that, when it finds an update (MSI) in a share of the network (UNC path), will run the update. Because the user cannot do installations. The update must be run with some other user with admin rights. The theory is sound but: it

How can a console application sudo itself under OS X if it needs root privileges? [closed]

僤鯓⒐⒋嵵緔 提交于 2020-01-04 06:21:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . I am wondering if it is possible for a command line application to request root access, like trying to call itself with sudo . I am looking for a solution that would allow to write applications that require sudo privileges if it is needed. It doesn't have to request root access always, only if needed. 回答1: The

PowerShell - script 1 calls script 2 - how to return value from script 2 to script 1

与世无争的帅哥 提交于 2019-12-29 09:13:12
问题 I have two PowerShell scripts. One script invokes another PowerShell script using elevated credentials, using Start-Process. But I am struggling with how to make the second script return the output value to the first script. Here is script # 1, which is invoked with script1.psl "sender-ip=10.10.10.10" function getUser($abc) { <#Previously created password file in C:\Script\cred.txt, read-host -assecurestring | convertfrom-securestring | out-file C:\Script\cred.txt#> $password = get-content C:

How to call a Win32 API with elevated priviledges on Windows 7

和自甴很熟 提交于 2019-12-25 07:45:47
问题 We have just discovered that code that calls the Win32 SetDateTime function needs to run in elevated mode in Windows 7, i.e. even when logged in as an administrator, one still has to choose to run the Set Date code as Administrator for the call to change the date. Is there anything I can do in code to always call this function under elevated privileges? 回答1: This is just not how security works. Changing the clock is a very intrusive operation, it has a very large number of side effects. There

How to capture “Root Path” into a variable

天涯浪子 提交于 2019-12-25 00:07:09
问题 I am trying to run logman.exe for a elevated CMD , for this below code I tried, var proc = new Process { StartInfo = new ProcessStartInfo { FileName = @"C:\Windows\System32\cmd.exe", Arguments = "cmd /k logman.exe PerfCounterCustom | findstr \"Root\"", Verb = "runas", UseShellExecute = true, } }; try { proc.Start(); while (!proc.StandardOutput.EndOfStream) { string line = proc.StandardOutput.ReadLine(); } Console.WriteLine("Successfully elevated!"); } catch (Exception ex) { Console.WriteLine

Script cannot read password

…衆ロ難τιáo~ 提交于 2019-12-24 21:38:18
问题 Python script is designed to run with elevated credentials, unfortunately it still prompts me for password when I enter the correct password it doesn't work Here is script1, which calls script2 with elevated credentials import os import sys, subprocess, socket, string import wmi, win32api, win32con import win32com.shell.shell as sh ASADMIN = '/user:DOMAIN\username' os.system('"runas /user:DOMAIN\username "D:/Python27/python.exe script2.py sender-ip=10.10.10.10 < password.txt""') sys.exit(0)

How to make the program run on startup with admin permission with Inno Setup?

帅比萌擦擦* 提交于 2019-12-23 03:02:40
问题 By following the Inno Setup KB: Create shortcuts in the Startup (or Autostart) group. I have these lines: [Setup] ... PrivilegesRequired=admin [Icons] Name: "{commonstartup}\app"; Filename: "app.exe" However on startup, it says "access denied". Looks like it is not run as administrator. What should I do? 回答1: If I understand your question correctly, your application requires to be run with elevated privileges. You cannot use the ancient "Startup" folder method to run applications with

Powershell start-process script calls a second script - how to make one script only

时光总嘲笑我的痴心妄想 提交于 2019-12-22 10:16:26
问题 I have a powershell script that accepts parameters in the form of "sender-ip=10.10.10.10" and that runs perfectly with elevated credentials #script.ps1 $userID=$NULL $line_array = @() $multi_array = @() [hashtable]$my_hash = @{} foreach ($i in $args){ $line_array+= $i.split(" ") } foreach ($j in $line_array){ $multi_array += ,@($j.split("=")) } foreach ($k in $multi_array){ $my_hash.add($k[0],$k[1]) } $Sender_IP = $my_hash.Get_Item("sender-ip") <#Gather information on the computer

Getting error - Access is denied in OpenProcess() after enabling privileges

余生长醉 提交于 2019-12-22 01:07:44
问题 I want to get executable path of csrss process. I enabled privileges, but GetLastError() function returns error 5 in OpenProcess. I'm running Visual Studio as administrator and compiling program in 64bit mode, also I'm using Windows 8. Thanks to all. HANDLE hcurrentProcess=GetCurrentProcess(); HANDLE hToken; size_t error; if (!OpenProcessToken(hcurrentProcess, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) return nullptr; if (CheckTokenPrivilege(hcurrentProcess, SE_DEBUG_NAME)) { LUID luid;