Set-AgentJobHistoryFilter
Sets filtering option used in Get-AgentJobHistory function.
Syntax
Set-AgentJobHistoryFilter [[-name] <String>] [[-endDate] <DateTime>] [[-startDate] <DateTime>] [[-outCome] <String>] [<CommonParameters>]
Detailed Description
The Set-AgentJobHistoryFilter function gets an JobHistoryFilter object that then can be used by the Get-AgentJobHistory function.
Related Commands
Parameters
Name |
Description |
Required? |
Pipeline Input |
Default Value |
name |
|
false |
false |
|
endDate |
|
false |
false |
|
startDate |
|
false |
false |
|
outCome |
|
false |
false |
|
Input Type
None
You cannot pipe objects to Set-AgentJobHistoryFilter
Return Values
Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter
Set-AgentJobHistoryFilter returns a Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter object.
Examples
EXAMPLE 1
Get-AgentJobHistory "Z002\sql2k8" $(Set-AgentJobHistoryFilter -outcome 'Failed')
This command gets the job history for all failed jobs for SQL Server Z002\SQL2K8.