How Can I Bypass UAC in Windows 11 for My Scripts?

0
7
Asked By TechWhiz42 On

I'm currently using Windows 10 and have figured out a way to run a Powershell script automatically at user login by creating a scheduled task that activates a Node.js script with admin permissions. This Node.js script downloads the appropriate Powershell script from a server, and everything works smoothly. However, I've run into a snag with Windows 11. The UAC (User Account Control) is now blocking my Powershell script from running without manual intervention, which means I can't automate the process like before.

I've considered turning off UAC completely, but that's not a viable option as it requires changing settings for all users on the machine. I'm exploring another possible solution: modifying my Node.js script to download the Powershell script locally instead of running it directly. Then I would create a separate scheduled task (with admin privileges) to execute the Powershell script after a 30-second delay upon login. The challenge is that each user's Powershell script will have a different name. Any thoughts or suggestions on how to tackle this?

5 Answers

Answered By ScriptMaster88 On

Who thinks this might be an X;Y problem? Sometimes the best solutions come from stepping back and re-evaluating the entire approach.

Answered By CodeNinja99 On

It sounds like you're trying to avoid a complex setup that could easily raise security flags. Maybe you should rethink the whole process? Instead of using a combination of scheduled tasks and Node.js to fetch and run the scripts, could there be a simpler way to achieve what you need without requiring elevated permissions? It might not only save you the hassle but also help your scripts avoid getting flagged as potential malware.

Answered By AdminGuru99 On

What’s the overall goal here? Knowing the use case might help others provide more tailored advice.

Answered By ScriptingWizard23 On

Have you thought about eliminating the need for admin rights entirely? You might want to explore impersonating the user with the SYSTEM account, which could allow the Powershell script to run without triggering UAC issues. I can't share the exact code right now, but it’s definitely worth looking into!

Answered By PowerShellPro77 On

If you're only using Node.js to download the Powershell script, consider just sticking with Powershell to handle this task. It's perfectly capable of making HTTP requests and downloading files, which could simplify your setup a lot.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.