PowerShell Logo Small

Unregister-ScheduledJob



This is the built-in help made by Microsoft for the command 'Unregister-ScheduledJob', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Deletes scheduled jobs on the local computer.

SYNTAX


Unregister-ScheduledJob [-InputObject] <ScheduledJobDefinition[]> [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]
Unregister-ScheduledJob [-Name] <String[]> [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]
Unregister-ScheduledJob [-Id] <Int32[]> [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Unregister-ScheduledJob cmdlet deletes scheduled jobs from the local computer.


When it deletes or "unregisters" a scheduled job, Unregister-ScheduledJob deletes the directory for the scheduled job (in the
$home\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs directory), which contains the XML file that defines the scheduled job, the job execution history, and all job
results. This action also deletes the job from Task Scheduler.


Unregister-ScheduledJob deletes only the scheduled jobs that are created by using the Register-ScheduledJob cmdlet. It does not delete scheduled jobs that are created in
Task Scheduler.


You can use the parameters of Unregister-ScheduledJob to delete scheduled jobs by ID or name, or pipe scheduled jobs from Get-ScheduledJob to Unregister-ScheduledJob.


Unregister-ScheduledJob is one of a collection of job scheduling cmdlets in the PSScheduledJob module that is included in Windows PowerShell.


For more information about Scheduled Jobs, see the About topics in the PSScheduledJob module. Import the PSScheduledJob module and then type: Get-Help about_Scheduled* or
see about_Scheduled_Jobs.


This cmdlet is introduced in Windows PowerShell 3.0.





<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=287623
about_Scheduled_Jobs
Add-JobTrigger
Disable-JobTrigger
Disable-ScheduledJob
Enable-JobTrigger
Enable-ScheduledJob
Get-JobTrigger
Get-ScheduledJob
Get-ScheduledJobOption
New-JobTrigger
New-ScheduledJobOption
Register-ScheduledJob
Remove-JobTrigger
Set-JobTrigger
Set-ScheduledJob
Set-ScheduledJobOption
Unregister-ScheduledJob

REMARKS

<

Examples


Example 1: Delete a scheduled job

PS C:\>Unregister-ScheduledJob TestJob



This command deletes the TestJob scheduled job on the local computer.




Example 2: Delete all scheduled jobs

PS C:\>Get-ScheduledJob | Unregister-ScheduledJob -Force


PS C:\>Unregistered-ScheduledJob -Name * -Force



This examples shows two different commands that delete all scheduled jobs on the local computer.

The first command uses the Get-ScheduledJob cmdlet to get all scheduled jobs on the local computer. A pipeline operator (|) sends the scheduled jobs to
Unregister-ScheduleJob, which deletes them.

The second command uses the Name parameter of Unregister-ScheduledJob with a value of all (*) to delete all scheduled jobs.

Both commands use the Force parameter, which deletes a scheduled job even if an instance of the job is running.




Example 3: Delete a scheduled job on a remote computer

PS C:\>Invoke-Command -ComputerName Server01 { Unregister-ScheduledJob -Name Test*}



This command deletes scheduled jobs with names that begin with "Test" on the Server01 remote computer. The command uses the Invoke-Command cmdlet to run the
Unregister-ScheduledJob command on the Server02 computer.