.. _community.windows.win_psexec_module:
****************************
community.windows.win_psexec
****************************
**Runs commands (remotely) as another (privileged) user**
.. contents::
:local:
:depth: 1
Synopsis
--------
- Run commands (remotely) through the PsExec service.
- Run commands as another (domain) user (with elevated privileges).
Requirements
------------
The below requirements are needed on the host that executes this module.
- Microsoft PsExec
Parameters
----------
.. raw:: html
Parameter |
Choices/Defaults |
Comments |
chdir
path
|
|
Run the command from this (remote) directory.
|
command
string
/ required
|
|
The command line to run through PsExec (limited to 260 characters).
|
elevated
boolean
|
|
Run the command with elevated privileges.
|
executable
path
|
Default:
"psexec.exe"
|
The location of the PsExec utility (in case it is not located in your PATH).
|
hostnames
list
/ elements=string
|
|
The hostnames to run the command.
If not provided, the command is run locally.
|
interactive
boolean
|
|
Run the program so that it interacts with the desktop on the remote system.
|
limited
boolean
|
|
Run the command as limited user (strips the Administrators group and allows only privileges assigned to the Users group).
|
nobanner
boolean
|
|
Do not display the startup banner and copyright message.
This only works for specific versions of the PsExec binary.
|
noprofile
boolean
|
|
Run the command without loading the account's profile.
|
password
string
|
|
The password for the (remote) user to run the command as.
This is mandatory in order authenticate yourself.
|
priority
string
|
Choices:
- abovenormal
- background
- belownormal
- high
- low
- realtime
|
Used to run the command at a different priority.
|
session
integer
|
|
Specifies the session ID to use.
This parameter works in conjunction with interactive.
It has no effect when interactive is set to no .
|
system
boolean
|
|
Run the remote command in the System account.
|
timeout
integer
|
|
The connection timeout in seconds
|
username
string
|
|
The (remote) user to run the command as.
If not provided, the current user is used.
|
wait
boolean
|
|
Wait for the application to terminate.
Only use for non-interactive applications.
|