Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 9 down vote accepted

Sure...works on Win7 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.

share|improve this answer
    
Thanks, that probably worked. Enable-ServerManagerStandardUserRemoting still doesn't add the user to the groups but at least that rules out any lack of elevation problem. –  NickC Jan 8 '13 at 16:15
    
I've never messed with that command...but I'm guessing you already looked here for details? technet.microsoft.com/library/jj205470 –  TheCleaner Jan 8 '13 at 17:14

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!

share|improve this answer
2  
if you're going to use runas.exe, the first step is unnecessary, just run it from cmd.exe –  Mathias R. Jessen Feb 18 at 15:08
1  
The difference here is mine was simply to run it elevated, not to run it as a different user. If you try mine out you'll see that you aren't prompted for additional credentials, it simply creates a new elevated shell. Yours is more for running Powershell as someone else. –  TheCleaner Feb 18 at 17:28
    
Mathias - thank you for correcting me, I'm by no means an expert! TheCleaner - Please don't misunderstand, your method is very good. I couldn't get it to work in my Core 2012 server setup but I'm sure it was my fault! So this was the alternative method, I'll edit the answer. –  Opera512 Feb 18 at 18:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.