Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. NetBackup™ Commands Reference Guide
  3. Appendix A. NetBackup Commands
  4. nbsqlcmd
NetBackup™ Commands Reference Guide

Name

nbsqlcmd — Configuration utility for Microsoft SQL Server assets

SYNOPSIS

nbsqlcmd list instances -format json [-S primary_server] [-limit limit] [-filter filter] [-sort sort]

nbsqlcmd list instances [-format csv] [-S primary_server] [-limit limit] [-name instance_name] [-hostname hostname] [-active | -inactive] [-registered | -unregistered]

nbsqlcmd list databases [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]

nbsqlcmd list availability_groups -format json [-S primary_server] [-limit limit] [-filter filter] [-sort sort]

nbsqlcmd list availability_groups [-format csv] [-S primary_server] [-limit limit] [-name name] [-cluster_name cluster_name] [-ag_id availability_group_id]

nbsqlcmd list credentials [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]

nbsqlcmd list replicas -ag_id ag_id [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]

nbsqlcmd add instance -name instance_name -hostname hostname [-S primary_server]

nbsqlcmd add replica -instance_id instance_asset_id -ag_id ag_asset_id [-S primary_server]

nbsqlcmd add availability_group -name ag_name { -cluster_name cluster_name | -guid ag_guid } [-S primary_server]

nbsqlcmd delete availability_group [-S primary_server] ASSET_ID

nbsqlcmd delete database [-S primary_server] ASSET_ID

nbsqlcmd delete instance [-S primary_server] ASSET_ID

nbsqlcmd delete replica [-S primary_server] ASSET_ID

nbsqlcmd discover availability_groups -instance_id instance_id [-S primary_server]

nbsqlcmd discover databases -instance_id instance_id [-S primary_server]

nbsqlcmd discover instances -hostname hostname [-S primary_server]

nbsqlcmd manage credentials -name credential_name [-S primary_server] ASSET_ID

nbsqlcmd modify instance [-state ACTIVE | INACTIVE] [-S primary_server] ASSET_ID

On UNIX systems, the directory path to this command is /usr/openv/netbackup/bin/

On Windows systems, the directory path to this command is install_path\NetBackup\bin\

DESCRIPTION

The nbsqlcmd command can add, list, modify, and delete SQL Server assets.

With the nbsqlcmd command, you can add a SQL Server instance asset or a SQL Server Availability Group asset. The command can associate an existing SQL Server instance asset with an Availability Group asset. The command lets you modify a given SQL Server instance asset with the given asset ID. You can use the command to discover instances on a specified host.

You can use the command to discover Availability Groups that are associated with a given SQL Server instance asset. You can also use the command to discover the databases that are associated with a given SQL Server instance asset.

The command lets you list SQL Server database and instance assets. You can also list SQL Server availability groups and SQL Server Availability Group replicas.

In addition to using nbsqlcmd to list NetBackup CMS SQL Server credentials you can also manage your credentials, and associate a given credential with an asset.

You can use the command to delete a SQL Server Availability Group asset, a SQL Server instance asset, or a SQL Server replica asset.

Before you run the nbsqlcmd command, you must run the bpnbat - login - loginType WEB command. The bpnbat command authenticates your web services logon. The user that is specified when you run bpnbat -login -loginType WEB should be a member of an RBAC role with Assets, SQL Server, View, and Recover permissions.

OPTIONS

-active

Filters the list of instances to only those that are active. Can only be used with -format csv.

-ag_id ag_id

The asset ID of an Availability group. Used as a filter for the list commands and input for the add replica command.

-ASSET_ID

A positional argument that must be specified at the end of the command. The asset ID of the asset to be modified, deleted, or managed.

-cluster_name cluster_name

The cluster name of an Availability Group. Used to filter on a specific cluster with the list command. Can only be used with -format csv. Used in add availability_group to set the cluster that is associated with the availability group.

-filter filter

Filters the data in the list. The filter value must be in OData format. Can only be used with -format json.

-format csv|json

Specifies the format to be used for the output. The default value is csv.

-guid guid

The GUID of the Availability Group being added as an asset.

-help

Prints the usage of the nbsqlcmd command.

-hostname hostname

The host name of an asset. When this option is used in the list command, it can only be used with -format csv.When the option is used with the discover instance command, it is the SQL server host name on which the instances reside.

-inactive

Filters the assets in list to only the assets that are inactive. Can only be used with -format csv.

-instance_id instance_id

The asset ID of an Instance.

-limit limit

The max number of items to be listed. Max of 100.

-name name

The display name of an asset. When the option is used with add credentials, this option is the name of the CMS named credential.

-registered

Filters the list of assets to only the assets that are registered. Can only be used with -format csv.

-S primary_server

Specifies the primary server that contains the asset to be listed or modified.

-sort sort

Sorts the data in the list. The sort value must be in OData format. Can only be used with -format json.

-state ACTIVE|INACTIVE

Specifies the new state to be assigned to the given instance asset.

-unregistered

Filters the list of assets to only the assets that are not registered. Can only be used with -format csv.

EXAMPLES

Example 1: List the instances and filter them based on the instance name.

nbsqlcmd list instances -format json -filter "commonAssetAttributes/
displayName eq 'MSSQLSERVER'"

SEE ALSO

See bplist.

See bpnbat.

Feedback

Was this page helpful?
Previous

nbsnapreplicate

Next

nbsqlite

Feedback

Was this page helpful?