ÿþ<html> <head> <title>Set-AgentJobHistoryFilter</title> </head> <body> <h1>Set-AgentJobHistoryFilter</h1> <div>Sets filtering option used in Get-AgentJobHistory function.</div> <h2> Syntax </h2> <code>Set-AgentJobHistoryFilter [[-name] &lt;String&gt;] [[-endDate] &lt;DateTime&gt;] [[-startDate] &lt;DateTime&gt;] [[-outCome] &lt;String&gt;] [&lt;CommonParameters&gt;]</code> <h2> Detailed Description </h2> <div> The Set-AgentJobHistoryFilter function gets an JobHistoryFilter object that then can be used by the Get-AgentJobHistory function. </div> <h2> Related Commands </h2> <div> * <a href='Set-AgentJobHistoryFilter.htm'>Set-AgentJobHistoryFilter </a><br/> * <a href='Get-AgentJobHistory.htm'>Get-AgentJobHistory</a><br/> </div> <h2> Parameters </h2> <table border='1'> <tr> <th>Name</th> <th>Description</th> <th>Required?</th> <th>Pipeline Input</th> <th>Default Value</th> </tr> <tr valign='top'> <td>name&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>endDate&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>startDate&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>outCome&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> </table> <h2> Input Type </h2> <div>None You cannot pipe objects to Set-AgentJobHistoryFilter</div> <h2> Return Values </h2> <div>Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter Set-AgentJobHistoryFilter returns a Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter object.</div> <h2> Examples </h2> <h3> EXAMPLE 1</h3> <pre>Get-AgentJobHistory "Z002\sql2k8" $(Set-AgentJobHistoryFilter -outcome 'Failed')</pre> <div>This command gets the job history for all failed jobs for SQL Server Z002\SQL2K8.</div> </body> </html>