Platform SDK: Network Management

NetScheduleJobDel

The NetScheduleJobDel function deletes a range of jobs queued to run at a computer. This function requires that the schedule service be started at the computer to which the job deletion request is being sent.

Security Requirements

Only members of the Administrators local group can successfully execute the NetScheduleJobDel function on a remote server.

NET_API_STATUS NetScheduleJobDel(
  LPCWSTR Servername,  
  DWORD MinJobId,     
  DWORD MaxJobId      
);

Parameters

Servername
[in] Pointer to a constant Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
MinJobId
[in] Specifies a minimum job identifier. Jobs with a job identifier smaller than MinJobId will not be deleted.
MaxJobId
[in] Specifies a maximum job identifier. Jobs with a job identifier larger than MaxJobId will not be deleted.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.

Remarks

Call the NetScheduleJobEnum function to retrieve the job identifier for one or more scheduled jobs.

The NetScheduleJobDel function deletes all jobs whose job identifiers are in the range MinJobId through MaxJobId.

To delete all scheduled jobs at the server, you can call NetScheduleJobDel specifying MinJobId equal to 0 and MaxJobId equal to – 1. To delete one job, specify the job's identifier for both the MinJobId parameter and the MaxJobId parameter.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmat.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, Schedule Functions, NetScheduleJobAdd, NetScheduleJobEnum