Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Server.JobServer Property


Gets the SQL Server Agent associated with the instance of SQL Server.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

[<SfcObjectAttribute(SfcObjectRelationship.Object, SfcObjectCardinality.One)>]
member JobServer : JobServer with get

Property Value

Type: Microsoft.SqlServer.Management.Smo.Agent.JobServer

A JobServer object that specifies the SQL Server Agent associated with the instance of SQL Server.

The JobServer object represents the SQL Server Agent. You can use the JobServer object to reference the SQL Server Agent jobs, operators, and alerts. SQL Server Agent settings can be viewed or modified by using the JobServer object.

Visual Basic


$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$al = new-object Microsoft.SqlServer.Management.Smo.Agent.Alert($srv.JobServer, "Test Alert")
$al.PerformanceCondition = "SQLServer:General Statistics|User Connections||>|3"
$op = new-object Microsoft.SqlServer.Management.Smo.Agent.Operator($srv.JobServer, "Test Operator")
$op.NetSendAddress = "NetworkPC"
$al.AddNotification("Test Operator", [Microsoft.SqlServer.Management.Smo.Agent.NotifyMethods]::NetSend)
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft