Service Members
The Service class represents an instance of the SQL Server service.
The following tables list the members exposed by the Service type.
Public Properties
名稱 | Description | |
---|---|---|
![]() |
AcceptsPause | Gets the Boolean property value that specifies whether the SQL Server service can be paused. |
![]() |
AcceptsStop | Gets the Boolean property value that specifies whether the SQL Server service can be stopped. |
![]() |
AdvancedProperties | Represents a collection of Property objects. Each Property object represents an advanced property defined on the SQL Server service. |
![]() |
Dependencies | Returns a list of services that are dependent on the referenced SQL Server service. |
![]() |
Description | Gets a textual description of the SQL Server service. |
![]() |
DisplayName | Gets the display name of the SQL Server service. |
![]() |
ErrorControl | Gets the severity of the error if the SQL Server service fails to start during startup. |
![]() |
ExitCode | Gets the Win32 error code that defines problems encountered when starting and stopping the SQL Server service. |
![]() |
Name | Gets or sets the name of the referenced Windows Management Instrumentation (WMI) object. (inherited from WmiSmoObject) |
![]() |
Parent | Gets the ManagedComputer object that is the parent of the Service object. |
![]() |
PathName | Gets the path and file name of the binary file that implements the SQL Server service. |
![]() |
ProcessId | Gets the process ID that uniquely identifies the SQL Server service. |
![]() |
Properties | Represents a collection of Property objects. Each Property object represents a property defined on the Windows Management Instrumentation (WMI) object. (inherited from WmiSmoObject) |
![]() |
ServiceAccount | Gets the system account under which the SQL Server service is running. |
![]() |
ServiceState | Gets the state of the SQL Server service, such as running, stopped, or paused. |
![]() |
StartMode | Gets or sets the method by which the SQL Server service is started. |
![]() |
StartupParameters | Gets or sets any startup parameters for the SQL Server service. |
![]() |
State | Gets the state of the referenced object. (inherited from SmoObjectBase) |
![]() |
Type | Gets the type of service, such as Microsoft Search service, SQL Server Agent service, or SQL Server service. |
![]() |
Urn | Gets the Uniform Resource Name (URN) address that represents the Windows Management Instrumentation (WMI) object. (inherited from WmiSmoObject) |
![]() |
UserData | Gets or sets user-defined data associated with the referenced object. (inherited from SmoObjectBase) |
頂端
Public Methods
(see also Protected Methods )
名稱 | Description | |
---|---|---|
![]() |
Alter | Updates any Service object property changes on an instance of SQL Server. |
![]() |
ChangePassword | Changes the password for the system account under which the SQL Server service is running. |
![]() |
Equals | Overloaded. (inherited from Object ) |
![]() |
GetHashCode | (inherited from Object ) |
![]() |
GetType | (inherited from Object ) |
![]() |
Initialize | Initializes the referenced object. (inherited from WmiSmoObject) |
![]() |
Pause | Pauses the SQL Server service. |
![]() ![]() |
ReferenceEquals | (inherited from Object ) |
![]() |
Refresh | Overridden. Refreshes the SQL Server service. |
![]() |
Resume | Resumes the SQL Server service. |
![]() |
SetServiceAccount | Sets the account under which the SQL Server service runs. |
![]() |
Start | Starts the SQL Server service. |
![]() |
Stop | Stops the SQL Server service. |
![]() |
ToString | (inherited from Object ) |
頂端
Protected Methods
名稱 | Description | |
---|---|---|
![]() |
AlterProtocolProperties | (inherited from WmiSmoObject ) |
![]() |
CheckObjectState | Checks the state of the referenced object. (inherited from WmiSmoObject) |
![]() |
CreateProtocolPropertyCollection | Creates a set of protocol attributes for the referenced object. (inherited from WmiSmoObject) |
![]() |
Finalize | (inherited from Object ) |
![]() |
GetPropertyManagementObject | (inherited from WmiSmoObject ) |
![]() |
GetPropertyObject | (inherited from WmiSmoObject ) |
![]() |
GetProtocolPropertyCollection | Returns the protocol property collection for the referenced object. (inherited from WmiSmoObject) |
![]() |
ImplInitialize | (inherited from WmiSmoObject ) |
![]() |
InvokeMgmtMethod | Overloaded. (inherited from WmiSmoObject ) |
![]() |
IsObjectInitialized | Specifies whether the referenced object is initialized. (inherited from WmiSmoObject) |
![]() |
MemberwiseClone | (inherited from Object ) |
![]() |
SetName | (inherited from WmiSmoObject ) |
![]() |
SetParentImpl | (inherited from WmiSmoObject ) |
![]() ![]() |
Trace | (inherited from WmiSmoObject ) |
![]() |
UpdateObjectState | Updates the object state. (inherited from WmiSmoObject) |
頂端
Public Events
名稱 | Description | |
---|---|---|
![]() |
ManagementStateChange | An event that occurs when the management state changes. |
頂端
請參閱
參考
Service Class
Microsoft.SqlServer.Management.Smo.Wmi Namespace
其他資源
Managing Services and Network Settings by Using WMI Provider
WMI and SQL Server
連接到 SQL Server Database Engine