Process Task

EDIS Online User Guide – Process Task

The process task allows you to run an executable file. This is similar to xp_cmdshell, but with one major difference. Our process task runs under the context of the caller, whereas xp_cmdshell runs under the context of the SQL Server service account. This provides more security to ensure that users can only execute what they have permission to execute. Below are a couple examples:

Procedure: SSISDB.EDIS.usp_run_process_task


Name Description Default Value
@process_nm Fully qualified path to the executable file you want to call None; Required
@args Arguments to pass to the executable Empty String
@output_tbl_nm Global temporary table to output the results to. This is optional and useful for capturing outputs such as echo messages and piped results Empty String



Example 1: Using CMD to get the current user

EXEC SSISDB.EDIS.usp_run_process_task

 @process_nm = 'C:\Windows\System32\cmd.exe'

,@args = '/c whoami.exe'

,@output_tbl_nm = '##users'

SELECT * FROM ##users


Example 2: Running a custom executable and passing arguments

EXEC SSISDB.EDIS.usp_run_process_task

 @process_nm = 'C:\program files\Dev Tools\maint_check.exe'

,@args = '"current" "this_pc" "1"'