418 questions
0
votes
1
answer
142
views
Install software as admin, but perform updates without admin rights
I'm using a Visual Studio setup project together with my own C# bootstrapper project that guides the user through the installation of my software (on Windows 11).
My main problem is that I need admin ...
1
vote
1
answer
159
views
How to capture the output of Start-Process into a variable
I am trying to use Start-Process to elevate a Get-WinEvent command, I want to use -Verb RunAs to generate the authentication pop up window, however I can't figure out how to capture the output (which ...
1
vote
1
answer
170
views
How do I write a script to copy an item to the public desktop?
I am trying to write a script to push through datto to copy a shortcut to each endpoint's public desktop. UAC is getting in my way, and I'm trying to find a way around it.
So far I have tried this ...
0
votes
1
answer
143
views
Run custom action in MSI before InstallExecuteSequence starts
I need to install .NET Runtime before installing my app.
I've read that it is impossible to run second installer after the first one started actions from InstallExecuteSequence table. So, I'm looking ...
0
votes
1
answer
186
views
PS1 Restart service as specified user
I'm trying to create a PS1 script to restart a service in a computer, where the user has no admin right, so i'm trying to execute as de admin user, now i'm trying first to open Notepad, but when I ...
1
vote
0
answers
54
views
Starting Elevated Subprocess In Elevated Python Without Shell
I'm attempting to run an executable that requires elevated privileges using the subprocess library with python. The behaviour works as expected when using shell=true, or first calling powershell.exe ...
-1
votes
1
answer
140
views
How to invoke a .bat file with elevated privileges from MATLAB
The goal invoke .bat files with administrative privilege from MATLAB. The Windows user account is a member of the administrators group, however, invoking the date command to change the system date / ...
8
votes
1
answer
770
views
Running Powershell from VBA with Administrator privileges
I have not been able to successfully run my PowerShell script from VBA with administrator privileges.
I have examined the various answers in this forum and attempted to adapt with no success.
When I ...
1
vote
1
answer
164
views
Supress "terminal-window" when executing an elevated windows command
An GUI application I wrote executes elevated diskpart /s some_script. This works fine except for the fact that a terminal window is popping open showing the execution of diskpart. I wonder if there ...
0
votes
0
answers
68
views
Users running program as administrator
I need my users to be able to run a program as an admin but dont want to get them the admin details.
We work in a remote desktop environment (Azure VDI) and when they run a particular program as ...
0
votes
1
answer
359
views
How to embed manifest into C++/WinAPI app with VS2022?
For my app to function properly and display running processes, it requires elevated permissions. I embed the manifest file for this purpose using the mt.exe tool.
If I make changes to the code and ...
0
votes
0
answers
109
views
Delete file using AppleScript as root with administrator privileges does not work if file was created/downloaded by user, not root
I need to solve the following problem on macOS: I must work with some files using a combination of AppleScript and Shell.
For example, I have a file in the file system in folder /Users/username/...
1
vote
2
answers
361
views
Run Powershell with parameters from batch file
For convenience of use, I need to put my powershell script in a bat file. The bat file content is as follows:
# 2>NUL & @CLS & PUSHD "%~dp0" & powershell -COMMAND "Start-...
0
votes
1
answer
410
views
Process started by Azure DevOps interactive environment agent ends when pipeline-job finishes
I want to deploy a long-running C#-executable to a Windows Server 2019 machine using Azure DevOps pipelines. The executable needs to run elevated and call an external application that cannot run in ...
0
votes
1
answer
409
views
How can I add a "Open Powershell Here as SYSTEM" command to my context menu that will open to the current directory as NT Authority\SYSTEM?
I have the following registry entry that creates a context menu to open a powershell shell as admin at the current directory:
"%bin%\Elevator" -dir "%V" -elev high pwsh -noexit
...
0
votes
1
answer
315
views
IE Mode Edge driver stuck on 'This is the initial start page for the WebDriver server' when running in Elevated Mode (Admin Mode) [Selenium]
I am trying to run IE Mode on Edge. When the browser instance loads, it gets stuck on
This is the initial start page for the WebDriver server
Selenium Version - 4.18.1
I am using the below args. when ...
-1
votes
2
answers
2k
views
Opening Microsoft Edge in Elevated mode (use case: open via Selenium)
I am trying to open Ms Edge in Elevated Mode, but I am unable to do so. (Windows 11)
I have tried to open it manually too, but the Elevated option is always set to 'No'.
Image showing Edge Elevated ...
1
vote
0
answers
22
views
How to run an app requiring admin privileges on standard user so that the user does not know the admin password? [duplicate]
I want two applications requiring a Windows administrator privileges to be run from a standard user account.
The standard user account is my child's account. I want her to be able to automatically run:...
0
votes
2
answers
361
views
Running in Windows Terminal After Got Administrator Right
Does anyone know how get Admin Privileges of Batch-file within Windows Terminal?
The script below got elevated in cmd it's self, not in/ through windows terminal
@echo off
Net session >nul 2>&...
0
votes
1
answer
124
views
Privilege Identity Management (Azure)
Is it possible to make different users have different maximum activation duration time for the same role in Azure. For example, User A has the user administrator role with a maximum activation time of ...
0
votes
2
answers
3k
views
How to start an application elevated on account without admin privileges on Windows 10
I need to start an application elevated on a user account without admin privileges. I am using Windows 10. The station will have two user accounts: admin and operator. All applications will be ...
1
vote
1
answer
4k
views
"Missing sudo password" error with Ansible Error
This is my simple playbook,
---
- name: test
hosts: all
tasks:
- name: testing
shell: /usr/bin/whoami
register: testing
- name: show the result
debug:
msg:...
1
vote
2
answers
341
views
ShellExecuteExW function with lpVerb = L"runas" and lpFile = L"cmd" succeeds but fails
I have a unit test for a class that is intended to run shell commands with elevated privileges. A simple test case is to copy a test file into C:\Program Files. The class makes a call to the C ...
1
vote
0
answers
118
views
Zephyr, defeating C_NULL_POINTER_EXCEPTION protection
I'm working on a project that uses Zephyr on a Nordic nRF52840 ARM CortexM. In the build they have the C NULL pointer exception protection enabled with:
CONFIG_NULL_POINTER_EXCEPTION_DETECTION_MPU=y
...
0
votes
1
answer
678
views
Is it possible to give my Android app root permissions without rooting the device? Perhaps with an MDM or a UEM?
I am writing an app where I would like to expose a service on a privileged port (i.e. <1024). This is not possible in Android without root permissions, from what I can see (I've made a test app, ...
1
vote
1
answer
84
views
What's the proper way to run a piece of code with admin privileges conditionally?
I am developing a C#/.NET/AvaloniaUI application that communicates with a USB device over libusb. This requires the WinUSB driver to be paired with the device on Windows. Most users in my use case ...
3
votes
1
answer
2k
views
My PowerShell script does not work when opening it from a batch file or the command line, but it works when running directly
What I am trying to do:
Use a .bat file to call a .ps1 file (don't ask) that generates a self-signed certificate and key pair (.pem), then the .bat file will move each .pem to a new directory.
What I ...
1
vote
1
answer
320
views
How can we trigger the PowerShell file with both another user and admin privileges
I want to launch the file c:\dfs-build.ps1 with the specific user and admin privileges for that I'm trying to use the below command but it's not working.
When I'm opening the powershell manually and ...
1
vote
0
answers
50
views
Opening domain computer's explorer from elevated PS script still prompts for credentials
I have a PowerShell script which requires admin rights to launch and therefore always runs elevated. It has options to run commands on remote computers on the same domain, which all work without re-...
1
vote
1
answer
924
views
Trying to create a powershell script to install a program on a remote computer on the same network
I'm very new to Powershell and I am trying to create a script whereby I copy a folder from one computer to another computer on the same network, and then run a batch file as an admin on the remote ...
0
votes
1
answer
885
views
How to assign Azure AD PIM to a custom RBAC role using BICEP
How to assign Azure AD PIM to a custom RBAC role using BICEP
I am trying to use the below BICEP template to assign PIM to the custom RBAC role at the subscription level of scope.
targetScope = '...
0
votes
0
answers
22
views
Can a non-elevated Windows process request elevation later in execution? [duplicate]
I'm running a program installed in Program Files, which of course is read-only without elevation. For some download-on-first-use features of the program, I'd like to download new files to the ...
4
votes
0
answers
1k
views
Hooking UAC consent.exe or
Have been working on Windows internals security stuff and trying to figure out a couple things:
When consent.exe is launched, what is the structure of the memory block passed as the third parameter ...
1
vote
1
answer
107
views
Bat File fails to start powershell script without hard-coded directory
My plan is as follows:
Open .bat file
File then opens a PS window with script execution allowed and as admin(!)
Directory must be variable for it to run on any PC in that folder.
Install Chocolatey ...
1
vote
1
answer
386
views
Registry modifications not taking effect when executing PowerShell script with admin rights
PowerShell script with admin rights doesn't modify registry entries when executed through Start-Process
I have a PowerShell script that modifies registry entries related to autologin settings. When I ...
0
votes
1
answer
565
views
Raise privileges to open a sqlite3 root database on Linux - C programming
I'm creating a Linux software that will have two types of databases:
Public: stores information that anyone on my_program_group has access (without root privileges);
Private: only users with sudo ...
2
votes
1
answer
266
views
Batch file auto-elevation using powershell and not mangling the arguments but problem with invokation
I am trying to implement the function proposed by
mklement0 on this answer
My goal is to implement this as a reusable batch subfunction
But before that I have run into a pattern of inconsistent ...
1
vote
1
answer
1k
views
How to set up a PowerShell command in Windows Task Scheduler with administrative privileges?
I am currently trying to run the command cup all -y with task scheduler in windows, which basically updates all the packages installed by Chocolatey package installer.
Screenshot of PowerShell ISE
I ...
1
vote
1
answer
1k
views
How can I elevate the privileges of an executable using setuid on Mac?
I want to create a simple script to restart the Mac. The command requires root privileges, so I decided to create an executable with the setuid bit set and the owner being root.
For testing the setuid ...
0
votes
1
answer
76
views
How can i script entering as administrator to cmd?
I'm writing this script in python, which needs to access to administrator privileges so it can start and stop services in Windows. I've found this line
runas /user:Administrator cmd
But it opens a ...
2
votes
1
answer
1k
views
PowerShell: Elevated code from non-elevated script, accessing variables and functions
I am preparing new computers. After applying an image, I run a PowerShell script for some post-image deployment steps. Some steps must be run as the new (current) user, like registry settings in HCCU, ...
1
vote
0
answers
351
views
Open CMD with the User Account Control (UAC) dialog
I am working on a JavaFX project. At some point in the program I need to ask the user for elevated rights to perform a certain action.
How can I code this action?
My program is coded to work on ...
0
votes
1
answer
961
views
How to give admin privileges for a Microsoft dev box user inside Dev box?
I created a dev box, but I need to install some software on the machine. It requires login to have admin privileges inside dev box. How do I access the Dev box with admin privileges?
I created a ...
1
vote
2
answers
658
views
How can I programmatically turn off or on 'Windows Features'
When I try to update Windows features; When I update UseShellExecute to "true"; "The Process object must have the UseShellExecute property set to false in order to redirect IO streams.&...
0
votes
1
answer
368
views
How does the Appinfo service creates an elevated process under the hood?
To my understanding, during logon if the user is part of Administrators group, lsass creates a medium IL filtered token with stripped out privileges and attaches it to the first user process. which ...
1
vote
1
answer
297
views
Powershell self-elevate loop
I'm one of the IT admins in our company. Lately, cyber-security want to get stricter on how easily users can read and/or write data on USB sticks and external mass storage. In addition all new users ...
0
votes
0
answers
617
views
Enable-ADAccount script occasionally fails due to password complexity
I'm trying to add all the AD users that have a samaccountname ending in some suffix to a few different AD groups. This code works for all of the users with the suffic except for one.
When trying to ...
0
votes
0
answers
91
views
Powershell issues with Start-Process of same script elevated
I have a script that inventories the installed software on a machine, based on certain criteria provided in arguments. It also needs to support being buried in a very deep folder structure (Architects ...
2
votes
1
answer
906
views
Execute postinstall program (sub installer) with administrator privileges in Inno Setup even if the main installer does not have them
Just like in this question, I'm trying to implement an installer which starts another 3rd party driver installer at the end of the installation.
This is achieved by running my installer with ...
0
votes
2
answers
3k
views
How to elevate to SYSTEM - needed to execute RunAsUser module
I need to execute a PS which creates registry entries for the current user and right after restarts a service (admin rights needed). I found a module called RunAsUser that seems to do this very nicely....