启动 SQL 代理服务
Microsoft.SQLServer.Windows.Task.LocalAgent.StartService (Task)
启动 SQL 代理服务
请注意,任何版本的 SQL Server Express 均不支持 SQL Server 代理 Windows 服务。
Element properties:
Member Modules:
Source Code:
<Task ID="Microsoft.SQLServer.Windows.Task.LocalAgent.StartService" Target="SqlDiscW!Microsoft.SQLServer.Windows.LocalAgent" Accessibility="Internal" Enabled="true" Remotable="false">
<Category>Maintenance</Category>
<WriteAction ID="WA" TypeID="Microsoft.SQLServer.Windows.WriteAction.ServiceControl" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Task">
<ComputerName>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.Agent"]/ComputerName$</ComputerName>
<ServiceName>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.Agent"]/ServiceName$</ServiceName>
<ServiceCommand>Start</ServiceCommand>
<TimeoutSeconds>300</TimeoutSeconds>
<Publisher>SQLMonitoringWindows</Publisher>
<ManagementGroupName>$Target/ManagementGroup/Name$</ManagementGroupName>
</WriteAction>
</Task>