JobServer JobServer JobServer Class

Definition

Instance class encapsulating : Server[@Name='']/JobServer

public sealed class JobServer : Microsoft.SqlServer.Management.Smo.SqlSmoObject, Microsoft.SqlServer.Management.Common.IAlterable, Microsoft.SqlServer.Management.Smo.IScriptable
type JobServer = class
    inherit SqlSmoObject
    interface IAlterable
    interface IScriptable
Public NotInheritable Class JobServer
Inherits SqlSmoObject
Implements IAlterable, IScriptable
Inheritance
Implements

Properties

AgentDomainGroup AgentDomainGroup AgentDomainGroup
AgentLogLevel AgentLogLevel AgentLogLevel
AgentMailType AgentMailType AgentMailType
AgentShutdownWaitTime AgentShutdownWaitTime AgentShutdownWaitTime
AlertCategories AlertCategories AlertCategories
Alerts Alerts Alerts
AlertSystem AlertSystem AlertSystem
DatabaseEngineEdition DatabaseEngineEdition DatabaseEngineEdition

Returns the DatabaseEngineEdition of the SMO object

(Inherited from SqlSmoObject)
DatabaseEngineType DatabaseEngineType DatabaseEngineType

Returns the DatabaseEngineType of the SMO object

(Inherited from SqlSmoObject)
DatabaseMailProfile DatabaseMailProfile DatabaseMailProfile
ErrorLogFile ErrorLogFile ErrorLogFile
ExecuteForScalar ExecuteForScalar ExecuteForScalar Inherited from SqlSmoObject
ExecutionManager ExecutionManager ExecutionManager Inherited from SqlSmoObject
HostLoginName HostLoginName HostLoginName
IdleCpuDuration IdleCpuDuration IdleCpuDuration
IdleCpuPercentage IdleCpuPercentage IdleCpuPercentage
IsCpuPollingEnabled IsCpuPollingEnabled IsCpuPollingEnabled
IsTouched IsTouched IsTouched

Whether the object has been touched for unconditional scripting of Alter

(Inherited from SqlSmoObject)
JobCategories JobCategories JobCategories
Jobs Jobs Jobs
JobServerType JobServerType JobServerType
LocalHostAlias LocalHostAlias LocalHostAlias
LoginTimeout LoginTimeout LoginTimeout
MaximumHistoryRows MaximumHistoryRows MaximumHistoryRows
MaximumJobHistoryRows MaximumJobHistoryRows MaximumJobHistoryRows
MsxAccountCredentialName MsxAccountCredentialName MsxAccountCredentialName
MsxAccountName MsxAccountName MsxAccountName
MsxServerName MsxServerName MsxServerName
Name Name Name
NetSendRecipient NetSendRecipient NetSendRecipient
ObjectInSpace ObjectInSpace ObjectInSpace Inherited from SqlSmoObject
OperatorCategories OperatorCategories OperatorCategories
Operators Operators Operators
Parent Parent Parent
Properties Properties Properties Inherited from SqlSmoObject
ProxyAccounts ProxyAccounts ProxyAccounts
ReplaceAlertTokensEnabled ReplaceAlertTokensEnabled ReplaceAlertTokensEnabled
SaveInSentFolder SaveInSentFolder SaveInSentFolder
ScalarResult ScalarResult ScalarResult Inherited from SqlSmoObject
ServiceAccount ServiceAccount ServiceAccount
ServiceStartMode ServiceStartMode ServiceStartMode
SharedSchedules SharedSchedules SharedSchedules
SqlAgentAutoStart SqlAgentAutoStart SqlAgentAutoStart
SqlAgentMailProfile SqlAgentMailProfile SqlAgentMailProfile
SqlAgentRestart SqlAgentRestart SqlAgentRestart
SqlServerRestart SqlServerRestart SqlServerRestart
State State State

Returns the state of the object

(Inherited from SmoObjectBase)
SysAdminOnly SysAdminOnly SysAdminOnly
TargetServerGroups TargetServerGroups TargetServerGroups
TargetServers TargetServers TargetServers
Urn Urn Urn

Returns the Urn of the object, computed on the fly

(Inherited from SqlSmoObject)
UserData UserData UserData Inherited from SmoObjectBase
WriteOemErrorLog WriteOemErrorLog WriteOemErrorLog

Methods

AddDatabaseContext(StringCollection) AddDatabaseContext(StringCollection) AddDatabaseContext(StringCollection)

method get called from the create script related method (from derived classes like Table, Index etc..)

(Inherited from SqlSmoObject)
Alter() Alter() Alter()
AlterImpl() AlterImpl() AlterImpl() Inherited from SqlSmoObject
AlterImplWorker() AlterImplWorker() AlterImplWorker() Inherited from SqlSmoObject
BindDefaultImpl(String, String, Boolean) BindDefaultImpl(String, String, Boolean) BindDefaultImpl(String, String, Boolean) Inherited from SqlSmoObject
BindRuleImpl(String, String, Boolean) BindRuleImpl(String, String, Boolean) BindRuleImpl(String, String, Boolean) Inherited from SqlSmoObject
CheckObjectState() CheckObjectState() CheckObjectState() Inherited from SqlSmoObject
CheckObjectState(Boolean) CheckObjectState(Boolean) CheckObjectState(Boolean)

This is a virtual function, so that derived classes can override it if they want to do additional checks on the state of the object

(Inherited from SqlSmoObject)
CheckObjectStateImpl(Boolean) CheckObjectStateImpl(Boolean) CheckObjectStateImpl(Boolean)

Checks object state Because it is not recusrive, this function can be called directly and which means derived classes can't supply their own validation

(Inherited from SqlSmoObject)
CleanObject() CleanObject() CleanObject() Inherited from SqlSmoObject
ClearHostLoginAccount() ClearHostLoginAccount() ClearHostLoginAccount()

Clears the SQL Server account and use integrated security to login to SQL Server.

ClearMsxAccount() ClearMsxAccount() ClearMsxAccount()

Clears the master server account ands use integrated security to login to the master server.

CreateImpl() CreateImpl() CreateImpl() Inherited from SqlSmoObject
CreateOrAlterImpl() CreateOrAlterImpl() CreateOrAlterImpl() Inherited from SqlSmoObject
CycleErrorLog() CycleErrorLog() CycleErrorLog()

Cycles SQLAgent error log

Discover() Discover() Discover()

Best Effort Discovery mechanism : This method reflects upon metadata and gets all available objects

(Inherited from SqlSmoObject)
DropImpl(Boolean) DropImpl(Boolean) DropImpl(Boolean)

drops the object

(Inherited from SqlSmoObject)
DropImplWorker(Urn, Boolean) DropImplWorker(Urn, Boolean) DropImplWorker(Urn, Boolean)

drops the object

(Inherited from SqlSmoObject)
DropJobByID(Guid) DropJobByID(Guid) DropJobByID(Guid)

Drops the SQLServerAgent job identified and removes the referencing Job object from the Jobs collection.

DropJobsByLogin(String) DropJobsByLogin(String) DropJobsByLogin(String)

Drops all SQLServerAgent jobs owned by the login identified and removes the referencing Job objects from the Jobs collection.

DropJobsByServer(String) DropJobsByServer(String) DropJobsByServer(String)

Drops all the jobs that originate on the specified server

EnumErrorLogs() EnumErrorLogs() EnumErrorLogs()

Gets the Agent error logs

EnumJobHistory() EnumJobHistory() EnumJobHistory()
EnumJobHistory(JobHistoryFilter) EnumJobHistory(JobHistoryFilter) EnumJobHistory(JobHistoryFilter)

The EnumHistory method returns a DataTable object that enumerates the execution history of all jobs.

EnumJobs() EnumJobs() EnumJobs()
EnumJobs(JobFilter) EnumJobs(JobFilter) EnumJobs(JobFilter)

The EnumJobs method returns a DataTable object that enumerates all jobs defined for a server.

EnumPerformanceCounters() EnumPerformanceCounters() EnumPerformanceCounters()
EnumPerformanceCounters(String) EnumPerformanceCounters(String) EnumPerformanceCounters(String)
EnumPerformanceCounters(String, String) EnumPerformanceCounters(String, String) EnumPerformanceCounters(String, String)
EnumPerformanceCounters(String, String, String) EnumPerformanceCounters(String, String, String) EnumPerformanceCounters(String, String, String)
EnumSubSystems() EnumSubSystems() EnumSubSystems()

The EnumSubSystems method returns a DataTable object that enumerates installed execution subsystems.

ExecuteNonQuery(StringCollection, Boolean, Boolean) ExecuteNonQuery(StringCollection, Boolean, Boolean) ExecuteNonQuery(StringCollection, Boolean, Boolean)

Executes sql statements

(Inherited from SqlSmoObject)
ExecuteWithModes(SqlExecutionModes, Action) ExecuteWithModes(SqlExecutionModes, Action) ExecuteWithModes(SqlExecutionModes, Action)

Executes the given action under the given execution modes.

Resets the original modes after the action completes or fails.

(Inherited from SqlSmoObject)
FormatSqlVariant(Object) FormatSqlVariant(Object) FormatSqlVariant(Object) Inherited from SqlSmoObject
GenerateAlterEvent() GenerateAlterEvent() GenerateAlterEvent() Inherited from SqlSmoObject
GenerateAlterEvent(Urn, Object) GenerateAlterEvent(Urn, Object) GenerateAlterEvent(Urn, Object) Inherited from SqlSmoObject
GetContextDB() GetContextDB() GetContextDB() Inherited from SqlSmoObject
GetDBName() GetDBName() GetDBName() Inherited from SqlSmoObject
GetFragOptionString(FragmentationOption) GetFragOptionString(FragmentationOption) GetFragOptionString(FragmentationOption) Inherited from SqlSmoObject
GetJobByID(Guid) GetJobByID(Guid) GetJobByID(Guid)

The GetJobByID method returns a SQL-DMO Job object referencing the SQL Server Agent job identified by the specified job identifier.

GetPropValue(String) GetPropValue(String) GetPropValue(String)

Retrieve the property value from :

  • The property bag directly if property is available (dirty or retrieved)
  • A call to our OnPropertyMissing method otherwise

    Will throw an exception if the property value is NULL in either case.

(Inherited from SqlSmoObject)
GetPropValueOptional(String) GetPropValueOptional(String) GetPropValueOptional(String)

Retrieve the property value from :

  • The property bag if the state is creating or we're in Design Mode (possible NULL value)
  • A call to our OnPropertyMissing method otherwise (will throw exception if value is NULL)
(Inherited from SqlSmoObject)
GetPropValueOptionalAllowNull(String) GetPropValueOptionalAllowNull(String) GetPropValueOptionalAllowNull(String)

Retrieve the property value from :

  • The property bag if the state is creating or we're in Design Mode (possible NULL)
  • A call to our OnPropertyMissing method otherwise (possible NULL)
(Inherited from SqlSmoObject)
GetRealValue(Property, Object) GetRealValue(Property, Object) GetRealValue(Property, Object)

Returns the real value for the property.

(Inherited from SqlSmoObject)
GetServerName() GetServerName() GetServerName() Inherited from SqlSmoObject
GetServerObject() GetServerObject() GetServerObject() Inherited from SqlSmoObject
GetSqlServerVersionName() GetSqlServerVersionName() GetSqlServerVersionName()

Gets the sqlserver public name for the current connection, e.g: will transfer "SQLTOOLS2008-2" to "SQL Server 2008".

(Inherited from SqlSmoObject)
GetUrnRecursive(StringBuilder) GetUrnRecursive(StringBuilder) GetUrnRecursive(StringBuilder)

Computes the Urn for the object.

(Inherited from SqlSmoObject)
GetUrnRecursive(StringBuilder, UrnIdOption) GetUrnRecursive(StringBuilder, UrnIdOption) GetUrnRecursive(StringBuilder, UrnIdOption)

Computes the Urn for the object, potentially including other fields in the definition besides the key fields.

(Inherited from SqlSmoObject)
ImplInitialize(String[], OrderBy[]) ImplInitialize(String[], OrderBy[]) ImplInitialize(String[], OrderBy[]) Inherited from SqlSmoObject
Initialize() Initialize() Initialize() Inherited from SqlSmoObject
Initialize(Boolean) Initialize(Boolean) Initialize(Boolean)

Initializes the object, by reading its properties from the enumerator

(Inherited from SqlSmoObject)
IsExpressSku() IsExpressSku() IsExpressSku()

Returns whether the server containing this object is an Express SKU

(Inherited from SqlSmoObject)
IsObjectDirty() IsObjectDirty() IsObjectDirty() Inherited from SqlSmoObject
IsObjectInitialized() IsObjectInitialized() IsObjectInitialized() Inherited from SqlSmoObject
IsObjectInSpace() IsObjectInSpace() IsObjectInSpace() Inherited from SqlSmoObject
IsSupportedProperty(String) IsSupportedProperty(String) IsSupportedProperty(String)

Validate whether the specified property is supported in current server environment

(Inherited from SqlSmoObject)
IsVersion80SP3() IsVersion80SP3() IsVersion80SP3() Inherited from SqlSmoObject
IsVersion90AndAbove() IsVersion90AndAbove() IsVersion90AndAbove() Inherited from SqlSmoObject
MarkDropped() MarkDropped() MarkDropped() Inherited from SqlSmoObject
MarkForDropImpl(Boolean) MarkForDropImpl(Boolean) MarkForDropImpl(Boolean) Inherited from SqlSmoObject
MsxDefect() MsxDefect() MsxDefect()

The MSXDefect method ends SQL Server Agent participation in a multiserver administration group.

MsxDefect(Boolean) MsxDefect(Boolean) MsxDefect(Boolean)

The MSXDefect method ends SQL Server Agent participation in a multiserver administration group.

MsxEnlist(String, String) MsxEnlist(String, String) MsxEnlist(String, String)

The MSXEnlist method initiates SQL Server Agent participation as a target for multiserver administration.

PostAlter() PostAlter() PostAlter()

this function is meant to be overriden by derived classes, if they have to do supplimentary actions after altering the object

(Inherited from SqlSmoObject)
PostCreate() PostCreate() PostCreate()

this function is meant to be overriden by derived classes, if they have to do supplimentary actions after object creation

(Inherited from SqlSmoObject)
PostDrop() PostDrop() PostDrop()

this function is meant to be overriden by derived classes, if they have to do supplimentary actions after dropping the object

(Inherited from SqlSmoObject)
PurgeJobHistory() PurgeJobHistory() PurgeJobHistory()

Purges the entire job history.

PurgeJobHistory(JobHistoryFilter) PurgeJobHistory(JobHistoryFilter) PurgeJobHistory(JobHistoryFilter)

The PurgeJobHistory method removes system records maintaining execution history for all jobs, or those matching the filter criteria specified.

ReadErrorLog() ReadErrorLog() ReadErrorLog()

Reads the current Agent error log

ReadErrorLog(Int32) ReadErrorLog(Int32) ReadErrorLog(Int32)

Reads the specified Agent error log

ReassignJobsByLogin(String, String) ReassignJobsByLogin(String, String) ReassignJobsByLogin(String, String)

The ReAssignJobsByLogin method changes ownership for any SQLServerAgent jobs currently owned by a login.

Refresh() Refresh() Refresh()

refreshes the object's properties by reading them from the server

(Inherited from SqlSmoObject)
RemoveJobByID(Guid) RemoveJobByID(Guid) RemoveJobByID(Guid)

The RemoveJobByID method drops the SQLServerAgent job identified and removes the referencing Job object from the Jobs collection.

RemoveJobsByLogin(String) RemoveJobsByLogin(String) RemoveJobsByLogin(String)

The RemoveJobsByLogin method drops all SQLServerAgent jobs owned by the login identified and removes the referencing Job objects from the Jobs collection.

Script() Script() Script()
Script(ScriptingOptions) Script(ScriptingOptions) Script(ScriptingOptions)
ScriptImpl() ScriptImpl() ScriptImpl() Inherited from SqlSmoObject
ScriptImpl(ScriptingOptions) ScriptImpl(ScriptingOptions) ScriptImpl(ScriptingOptions)

Returns a StringCollection object with the script for the object. This method throws an error if ScriptData is true

(Inherited from SqlSmoObject)
SetAccessToken(IRenewableToken) SetAccessToken(IRenewableToken) SetAccessToken(IRenewableToken)

Set the accessToken for connection.

(Inherited from SqlSmoObject)
SetHostLoginAccount(String, String) SetHostLoginAccount(String, String) SetHostLoginAccount(String, String)

Sets the SQL Server Account and Password that is used to login to SQL Server.

SetMsxAccount(String) SetMsxAccount(String) SetMsxAccount(String)

Sets the master server account credential name that is used to store the MSX account information. This is available only for SQL Server 2005.

SetMsxAccount(String, String) SetMsxAccount(String, String) SetMsxAccount(String, String)

Sets the master server account. This is available only for SQL Server 2000.

SetParentImpl(SqlSmoObject) SetParentImpl(SqlSmoObject) SetParentImpl(SqlSmoObject) Inherited from SqlSmoObject
StartMonitor(String, Int32) StartMonitor(String, Int32) StartMonitor(String, Int32)

The StartMonitor method begins monitoring of the local SQLServerAgent service by an instance of SQL Server.

StopMonitor() StopMonitor() StopMonitor()

The StopMonitor method ends monitoring of the local SQLServerAgent service by an instance of SQL Server.

TestMailProfile(String) TestMailProfile(String) TestMailProfile(String)

Tests the mail profile. Returns true when a failure occurs. In that case the errorMessage will contain the related error message.

TestNetSend() TestNetSend() TestNetSend()

Tests the net send.

ThrowIfAboveVersion100(String) ThrowIfAboveVersion100(String) ThrowIfAboveVersion100(String)

Throws an exception if the ServerVersion major version for this object is above 10.0 (SQL 2008)

(Inherited from SqlSmoObject)
ThrowIfAboveVersion80(String) ThrowIfAboveVersion80(String) ThrowIfAboveVersion80(String)

Throws an exception if the ServerVersion major version for this object is above 8.0 (SQL 2000)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion100(String) ThrowIfBelowVersion100(String) ThrowIfBelowVersion100(String)

Throws an exception if the ServerVersion major version for this object is below 10.0 (SQL 2008)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion110(String) ThrowIfBelowVersion110(String) ThrowIfBelowVersion110(String)

Throws an UnsupportedVersionException if either the source or destination server is below 11.0 (SQL 2012)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion110Prop(String) ThrowIfBelowVersion110Prop(String) ThrowIfBelowVersion110Prop(String)

Throws an exception with text saying the specified property is not supported if the ServerVersion major version for this object is below 11.0 (SQL 2012)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion120(String) ThrowIfBelowVersion120(String) ThrowIfBelowVersion120(String)

Throws an exception if the ServerVersion major version for this object is below 12.0 (SQL 2014)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion120Prop(String) ThrowIfBelowVersion120Prop(String) ThrowIfBelowVersion120Prop(String)

Throws an exception with text saying the specified property is not supported if the ServerVersion major version for this object is below 12.0 (SQL 2014)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion130(String) ThrowIfBelowVersion130(String) ThrowIfBelowVersion130(String)

Throws an exception if the ServerVersion major version for this object is below 13.0 (SQL 2016)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion130Prop(String) ThrowIfBelowVersion130Prop(String) ThrowIfBelowVersion130Prop(String)

Throws an exception with text saying the specified property is not supported if the ServerVersion major version for this object is below 13.0 (SQL 2016)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion140(String) ThrowIfBelowVersion140(String) ThrowIfBelowVersion140(String)

Throws an exception if the ServerVersion major version for this object is below 14.0 (SQL 2017)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion140Prop(String) ThrowIfBelowVersion140Prop(String) ThrowIfBelowVersion140Prop(String)

Throws an exception with text saying the specified property is not supported if the ServerVersion major version for this object is below 14.0 (SQL 2017)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion80(String) ThrowIfBelowVersion80(String) ThrowIfBelowVersion80(String)

Throws an exception if the ServerVersion major version for this object is below 8.0 (SQL 2000)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion80SP3() ThrowIfBelowVersion80SP3() ThrowIfBelowVersion80SP3()

Throws an exception if the ServerVersion for this object is below 8.760 (8.0 SP3)

(Inherited from SqlSmoObject)
ThrowIfBelowVersion90(String) ThrowIfBelowVersion90(String) ThrowIfBelowVersion90(String)

Throws an exception if the ServerVersion major version for this object is below 9.0 (SQL 2005)

(Inherited from SqlSmoObject)
ToString() ToString() ToString() Inherited from SqlSmoObject
Touch() Touch() Touch()

Mark the object "touched" for unconditional scripting of Alter.

(Inherited from SqlSmoObject)
TouchImpl() TouchImpl() TouchImpl()

Virtual method to allow derived classes to do additional work when touched.

(Inherited from SqlSmoObject)
UnbindDefaultImpl(Boolean) UnbindDefaultImpl(Boolean) UnbindDefaultImpl(Boolean) Inherited from SqlSmoObject
UnbindRuleImpl(Boolean) UnbindRuleImpl(Boolean) UnbindRuleImpl(Boolean) Inherited from SqlSmoObject
Validate(String, Object[]) Validate(String, Object[]) Validate(String, Object[]) Inherited from SmoObjectBase

Fields

m_ExtendedProperties m_ExtendedProperties m_ExtendedProperties Inherited from SqlSmoObject
singletonParent singletonParent singletonParent

Regular SMO objects access the parent class reference through parentColl (corresponding collection in parent class). Singleton class has no collection in parent.

(Inherited from SqlSmoObject)

Explicit Interface Implementations

IAlienObject.Discover() IAlienObject.Discover() IAlienObject.Discover() Inherited from SqlSmoObject
IAlienObject.GetDomainRoot() IAlienObject.GetDomainRoot() IAlienObject.GetDomainRoot() Inherited from SqlSmoObject
IAlienObject.GetParent() IAlienObject.GetParent() IAlienObject.GetParent() Inherited from SqlSmoObject
IAlienObject.GetPropertyType(String) IAlienObject.GetPropertyType(String) IAlienObject.GetPropertyType(String)

Discovers type of property.

(Inherited from SqlSmoObject)
IAlienObject.GetPropertyValue(String, Type) IAlienObject.GetPropertyValue(String, Type) IAlienObject.GetPropertyValue(String, Type)

Retrieves value for a given property. Throws if property is not found.

(Inherited from SqlSmoObject)
IAlienObject.GetUrn() IAlienObject.GetUrn() IAlienObject.GetUrn() Inherited from SqlSmoObject
IAlienObject.Resolve(String) IAlienObject.Resolve(String) IAlienObject.Resolve(String) Inherited from SqlSmoObject
IAlienObject.SetObjectState(SfcObjectState) IAlienObject.SetObjectState(SfcObjectState) IAlienObject.SetObjectState(SfcObjectState)

Sets state of this object based on provided SfcObjectState.

(Inherited from SqlSmoObject)
IAlienObject.SetPropertyValue(String, Type, Object) IAlienObject.SetPropertyValue(String, Type, Object) IAlienObject.SetPropertyValue(String, Type, Object)

Sets the value of given property, if it is writable. If property is not in property bag, reflection is used. Throws exception if the property is not found.

(Inherited from SqlSmoObject)
ISfcPropertyProvider.GetPropertySet() ISfcPropertyProvider.GetPropertySet() ISfcPropertyProvider.GetPropertySet() Inherited from SqlSmoObject

Events

PropertyChanged PropertyChanged PropertyChanged Inherited from SqlSmoObject
PropertyMetadataChanged PropertyMetadataChanged PropertyMetadataChanged Inherited from SqlSmoObject

Applies to