Job.EnumJobStepLogs Method

Enumerates a list of job step log files for the referenced job.

Namespace:  Microsoft.SqlServer.Management.Smo.Agent
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public DataTable EnumJobStepLogs()

Return Value

Type: System.Data.DataTable
A DataTable object value that contains an enumerated list of all the job step log files.

The following code example creates a job then displays the job step log files.

C#

Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
DataTable stepLogs = jb.EnumStepLogs();

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = $srv.JobServer.Jobs["Test Job"]
$stepLogs = $jb.EnumStepLogs()

Community Additions

ADD
Show: