summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorpiyushawasthi <piyush.awasthi@msystechnologies.com>2017-07-31 15:39:51 +0530
committerBryan McLellan <btm@loftninjas.org>2017-08-08 11:36:26 -0400
commit1fc2b032f1c5aec68b08556d178551392a6db616 (patch)
tree2c2d6f1ab826836d0040be6e19eaf18425954537 /README.md
parente4ba49a92d2c0fc1d9fb8dc79660158e1941b76b (diff)
downloadmixlib-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.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index 909dd5e..368c113 100644
--- a/README.md
+++ b/README.md
@@ -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.