Run On-Demand Agent Job Discovery

Microsoft.SQLServer.Windows.Task.Agent.TriggerOnDemandAgentJobDiscovery (Task)

This task allows you to run on-demand Agent Job discovery on a selected SQL Server Agent on Windows. Note that before running this task, make sure that Agent Job discovery is enabled.

Element properties:

TargetMicrosoft.SQLServer.Windows.Agent
AccessibilityInternal
CategoryMaintenance
EnabledTrue
RemotableFalse
Timeout300

Member Modules:

ID Module Type TypeId RunAs 
WA WriteAction Microsoft.SQLServer.Windows.WriteAction.OnDemandDiscoveryTrigger Microsoft.SQLServer.Core.RunAs.Task

Source Code:

<Task ID="Microsoft.SQLServer.Windows.Task.Agent.TriggerOnDemandAgentJobDiscovery" Target="Microsoft.SQLServer.Windows.Agent" Accessibility="Internal" Enabled="true" Remotable="false">
<Category>Maintenance</Category>
<WriteAction ID="WA" TypeID="Microsoft.SQLServer.Windows.WriteAction.OnDemandDiscoveryTrigger" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Task">
<ManagementGroupId>$Target/ManagementGroup/Id$</ManagementGroupId>
<DiscoveryId>$MPElement[Name='Microsoft.SQLServer.Windows.Discovery.AgentJob']$</DiscoveryId>
<TargetInstanceId>$Target/Id$</TargetInstanceId>
<TaskTimeoutSeconds>300</TaskTimeoutSeconds>
</WriteAction>
</Task>