46

Is there a way to run a Powershell Prompt with Elevated privileges from a command linein Server 2012?

Problem is this is 'Minimal Server Interface' mode without full server-gui installed so I can run powershell from only either the command prompt or from ServerManager.

I am actually trying to run the command: Enable-ServerManagerStandardUserRemoting but although this appears to work it does not add the user in question to the various groups as it is supposed to do. I suspect it is not working properly because I am not running it from a fully elevated powershell prompt, just a standard prompt but as Administrator.

Thanks, Nick

NickC
  • 2,513

2 Answers2

61

Sure... works on Windows 7+, too.

Open Powershell first:

Type PowerShell to enter a PowerShell session.

Once in the session:

Type Start-Process PowerShell -Verb RunAs and press Enter.

That will open a new Powershell process as Administrator.

------- OR -------

To do it all with only one line from the command prompt, just type:

powershell -Command "Start-Process PowerShell -Verb RunAs"

Nnnes
  • 103
TheCleaner
  • 33,047
1

An alternative method is to do the following:

  1. type: runas /user:admin username powershell
  2. enter the appropriate password when prompted

You're done!