I'm facing a dilemma with a remediation script I want to create for users. The goal is to automate common issues I've been getting ticket requests for. However, some tasks in the script need to run in the user context while others require admin privileges. I'm considering having users execute the script, but I'm concerned about the prompts for admin consent. Is there a method to maintain an elevated PowerShell session throughout the script execution, or should I compile a list of admin-required actions and run them using 'run as'? Any suggestions?
1 Answer
You can use `Enter-PSSession` with your admin credentials, which avoids those annoying prompts if everything is set correctly. Just ensure that PowerShell remoting is enabled on the devices. Check the Microsoft docs for guidelines on that.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures