Powershell – Run Elevated Powershell prompt from command-line

powershellwindows-server-2012

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

Best Answer

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"