To use the runas command, you need access to a graphical user interface (GUI). This command will not work in a shell environment.
runas
You can execute the command as follows:
runas /user:$UserName powershell
You'll be prompted to enter the password for the specified user.
A new window will open, running as the user you specified.
Last updated 1 year ago