Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Start-JobSchedulerExecutableFile -Path <String> [-Argumentlist <String>] [-TargetName <String>] [-NoStandardOutputNoStandardOutpu
t] -NoStandardError -NoLoadUserProfile [<CommonParameter <CommonParameters> s>]

DESCRIPTION

Runs the specified executable file in the context of a different user account.
The cmdlet reads credentials from the Windows Credential Manager, i.e. credentials
that have previously been added by the Windows command "cmdkey" or any other credential management tools.
Credentials are indicated by their "target name" which represents the identifier by which
credentials are retrieved.

...

-Path <String>
Specifies the full path and name of the executable file to be started. Executable files includes binary files (.com
, .exe)
and command scripts (.cmd, .bat).

...

Target names for credentials can be added e.g. by use of the "cmdkey" command with the account that JobScheduler is
operated for:

C:\> cmdkey /add:run_as_ap /user:ap /pass:ap

...

C:\PS>$process = Start-ExecutableFile -Path 'c:/tmp/powershell/sample_script.cmd' -TargetName 'localhost' -NoStandardOutput NoStandardOu
tput -NoStandardError

Runs the command script for the account that is specified with the credentials identified by the target name.

...