Hey everyone! I usually connect to computers using a pre-configured admin session in PowerShell. I'm looking for a command that would help me switch from this admin session to a non-admin session. Any suggestions?
4 Answers
You can use the command `runas /user:%USERNAME% powershell.exe` to open a new PowerShell window as a non-admin. It's a quick way to access a non-elevated session without messing with the current one.
Please clarify what you're aiming to do with a non-admin session. Sometimes, knowing the goal can lead to better solutions. If you're trying to run a script as a different user, there might be more efficient ways to handle that.
Just a heads up, if that 'pre-configured admin session' you're using means you're auto-logging in as an elevated user, that's risky for security. It might be worth re-evaluating how you're setting that up.
If you're looking to run a separate, non-elevated session, you can use `Start-Process Powershell -Verb RunAsUser`. But remember, once a PowerShell session is running as admin, you can't downgrade it – you'd need to start another session.
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