ServiceQuery Class

MSBuild

Task that can determine the status of a specified service on a target server.


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class ServiceQuery
    Inherits Task
C#
public class ServiceQuery : Task
C++
ref class ServiceQuery : Task
J#
public class ServiceQuery extends Task
JScript
public class ServiceQuery extends Task

Example

Check status of SQL Server

 Copy Code
            <ServiceQuery ServiceName="MSSQLServer">
                <Output TaskParameter="Status" PropertyName="ResultStatus" />
            </ServiceQuery>
            <Message Text="MSSQLServer Service Status: $(ResultStatus)"/>
            

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.ServiceQuery
         MSBuild.Community.Tasks.ServiceController

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.