Notifications

216 views

Description

"sqlcmd" commands in "MsSql DB On Windows" Pattern fail to authenticate when the password variable is passed with quotations.

One example would be the command used in step "get server properties from sql query":

"sqlcmd -h-1 -U $$username$$ -P '$$password$$' -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"select SERVERPROPERTY('ProductLevel') AS ProductLevel, SERVERPROPERTY('EngineEdition') AS Engine,SERVERPROPERTY('ProductVersion') AS ProductVersion;\""

Steps to Reproduce

  1. Enable the Discovery plugin
  2. Configure a MID server
  3. Enable pattern based discovery
  4. Add the required Windows Credentials and Applicative Credentials for the Microsoft SQL Server
  5. Run discovery for a windows server hosting MsSQL database

Workaround

Remove the single quote for the password parameter value as follows:

"sqlcmd -h-1 -U $$username$$ -P $$password$$ -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"select SERVERPROPERTY('ProductLevel') AS ProductLevel, SERVERPROPERTY('EngineEdition') AS Engine,SERVERPROPERTY('ProductVersion') AS ProductVersion;\""

Related Problem: PRB1322425

Seen In

Kingston Patch 9

Intended Fix Version

New York

Fixed In

London Patch 9
Madrid Patch 4

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-08-06 08:52:40
Published:2019-01-25