Share via


Job.EnumJobStepLogs Method (String)

Enumerates a list of job step log files for the job step with the specified name.

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

Syntax

'Declaration
Public Function EnumJobStepLogs ( _
    stepName As String _
) As DataTable
'Usage
Dim instance As Job 
Dim stepName As String 
Dim returnValue As DataTable 

returnValue = instance.EnumJobStepLogs(stepName)
public DataTable EnumJobStepLogs(
    string stepName
)
public:
DataTable^ EnumJobStepLogs(
    String^ stepName
)
member EnumJobStepLogs : 
        stepName:string -> DataTable
public function EnumJobStepLogs(
    stepName : String
) : DataTable

Parameters

Return Value

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

Examples

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

C#

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

PowerShell

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

See Also

Reference

Job Class

EnumJobStepLogs Overload

Microsoft.SqlServer.Management.Smo.Agent Namespace

Other Resources

Scheduling Automatic Administrative Tasks in SQL Server Agent

Automated Administration Tasks (SQL Server Agent)

sp_help_jobsteplog (Transact-SQL)