[chef] Re: Running powershell script as Admin?


Chronological Thread 
  • From: Peter Loron < >
  • To:
  • Subject: [chef] Re: Running powershell script as Admin?
  • Date: Mon, 23 Sep 2013 10:58:25 -0700

Hi. Charles. Yes, already looked there. Those show how to run commands in powershell, which is working fine. However, I need to run some commands with admin rights (run as Administrator). In the desktop, I can just do with with a right-click when launching Powershell. How do I duplicate this via Chef? Our boxes do not have local admin enabled, so I can't just use that user.

-Pete

On Sep 20, 2013, at 4:13 PM, Charles Johnson < "> > wrote:

Check out the Powershell cookbook:

and the Windows cookbook.


Thanks,
--Charles


Charles Johnson — Solutions Engineer

(510) 454-9485 –  " style="color: rgb(105, 117, 130); ">  – my: Linkedin  Twitter

OPSCODE

CODE CAN

opscode.com   Blog   Facebook   Twitter   YouTube

On September 20, 2013 at 3:03:53 PM, Peter Loron ( "> ) wrote:

I need to run a bit of powershell code in a recipe with elevated privs. Specifically, I need to run 'enable-psremoting -force'.

By hand, I'd RDP to the box, and start a shell as Administrator and be done.

How can I duplicate this in a chef recipe?

Thanks.

-Pete




Archive powered by MHonArc 2.6.16.

§