Sdílet prostřednictvím


nscontrol status Command

Displays the enabled or disabled state of the specified instance, applications, and their components. It also displays the status of the NS$<instance_name> Windows service or services that are associated with the instance.

Syntax

nscontrol status 
    [-nologo]
    [-help]
        -name instanceName
    [-server databaseServer] 
    [-application applicationName] 
    [-sqlusername sqlUserName -sqlpassword sqlPassword]

Arguments

  • -nologo
    Suppresses the product and version statement that appears when you run an nscontrol command.
  • -help
    Displays the command syntax.
  • -nameinstanceName
    Is the name of the instance on which to report status.
  • -serverdatabaseServer
    Is the name of the server that hosts the instance and application databases.

    When you run nscontrol status on a system where the instance is registered, use the -name argument but not the -server argument. The nscontrol utility determines the Microsoft SQL Server instance name by reading the registry information of the instance.

    When you run nscontrol status on a system where the instance is not registered, you must use both the -name and -server arguments, because nscontrol needs both the Notification Services instance name and the SQL Server instance name.

  • -applicationapplicationName
    Is the name of the application on which to report status. If you do not specify an application name, nscontrol status reports status for all the applications that are hosted by the instance.
  • -sqlusernamesqlUserName
    If you are using SQL Server Authentication to connect to SQL Server, you must specify both the -sqlusername and -sqlpassword arguments.

    If you are using Windows Authentication, do not specify the -sqlusername and -sqlpassword arguments.

  • -sqlpasswordsqlPassword
    Is the password that is associated with the -sqlusername logon ID. This argument must be used together with the -sqlusername argument.

Remarks

The nscontrol status command displays the status of each component, with the system name in parentheses.

The hosted event providers, generator, and distributors can have the following status values: Enabled, Enable Pending, Disabled, and Disable Pending. For descriptions of the possible status values, see Viewing the Status of Instances, Applications, and Components.

Component status is updated when the service starts. If you scale out an instance across multiple computers, you must start all Windows services for all status to be updated.

Subscribers and subscriptions can have a status of Enabled or Disabled. These components are not dependent on the NS$instance_name Windows service.

The nscontrol enable command and the nscontrol disable command also display status information.

Permissions

The account used to run nscontrol status, or the SQL Server logon ID specified by the -sqlusername argument, must be a member of one of the following database roles: NSAnalysis, NSDistributor, NSEventProvider, NSGenerator, NSReader, NSRunService, NSSubscriberAdmin, or NSVacuum.

The account also must also have permission to execute the Notification Services binary files; this permission is granted to members of the Administrators and SQLServerNotificationServicesUser Windows groups.

If using NS$<instanceName> Windows services to run the instance of Notification Services, nscontrol status displays the status for the services, so the account must be an Administrator on all computers where the Windows service runs.

Examples

The following examples illustrate how to display status in multiple scenarios.

A. Displaying the status of an instance

This example shows how to display the status of an instance named StockInstance. The nscontrol utility uses Windows Authentication to connect to SQL Server.

nscontrol status -name StockInstance

B. Displaying the status of an application

This example shows how to display the status of the Stock application in an instance named StockInstance. The nscontrol utility uses Windows Authentication to connect to SQL Server.

nscontrol status -name StockInstance -application Stock

C. Displaying the status of an instance from an administration computer

This example shows how to display the status of an instance when the instance is not registered on the computer. To display the status, you must use the –server argument to supply the database server name.

The nscontrol utility uses Windows Authentication to connect to SQL Server.

nscontrol status -name StockInstance -server nsuetest 
    -application Stock 

D. Displaying the status of an instance using SQL Server Authentication

Important

When possible, use Windows Authentication.

This example shows how to display the status of an instance named StockInstance using SQL Server Authentication to connect to SQL Server.

nscontrol status -name StockInstance -sqlusername SqlUser 
    -sqlpassword sQl-P@sWd

See Also

Reference

nscontrol Utility

Other Resources

Viewing the Status of Instances, Applications, and Components

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

5 December 2005

New content:
  • Added information about the SQLServerNotificationServicesUser Windows group.