How can I switch from an admin PowerShell session to a non-admin one?

0
1
Asked By TechieGal42 On

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

Answered By CuriousCoder88 On

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.

Answered By SkepticalSquirrel On

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.

Answered By SecuritySkeptic99 On

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.

Answered By PowerShellNinja01 On

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

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.