diff options
author | piyushawasthi <piyush.awasthi@msystechnologies.com> | 2017-07-31 15:39:51 +0530 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2017-08-08 11:36:26 -0400 |
commit | 1fc2b032f1c5aec68b08556d178551392a6db616 (patch) | |
tree | 2c2d6f1ab826836d0040be6e19eaf18425954537 /README.md | |
parent | e4ba49a92d2c0fc1d9fb8dc79660158e1941b76b (diff) | |
download | mixlib-shellout-1fc2b032f1c5aec68b08556d178551392a6db616.tar.gz |
Added example for elevated privileges
Signed-off-by: piyushawasthi <piyush.awasthi@msystechnologies.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -61,6 +61,14 @@ Invoke "whoami.exe" to demonstrate running a command as another user: whoami.run_command ``` +Invoke "whoami.exe" with elevated privileges: + +```ruby + whoami = Mixlib::ShellOut.new("whoami.exe", :user => "username", :domain => "DOMAIN", :password => "password", :elevated => true) + whoami.run_command +``` +**NOTE:** The user 'admin' must have the 'Log on as a batch job' permission and the user chef is running as must have the 'Replace a process level token' and 'Adjust Memory Quotas for a process' permissions. + ## Platform Support Mixlib::ShellOut does a standard fork/exec on Unix, and uses the Win32 API on Windows. There is not currently support for JRuby. |