Search Knowledge Base by Keyword

PowerShell: Microsoft SQL

< Back

Overview

This connector reads Microsoft SQL Server tables by running a PowerShell script on a Windows host instead of connecting from the ReadyWorks application server. SQL Server is the dominant relational database on Windows estates and the back end of most Windows-based management tooling, including Configuration Manager site databases and the majority of Windows ITSM, CMDB and asset platforms.

The connection names the SQL Server instance, a port (the default is 1433), an optional source database, optional credentials, and a temporary working path on the Windows host. Each job’s Data Selection field carries the T-SQL statement to run, and the result set is written to the named staging table. The script CX_MSSQL.ps1 performs the connection and the query.

The deployment difference is the point of this connector. Running from a Windows host puts the query inside the Windows security and network boundary, which matters for two reasons. It avoids exposing a database port to the ReadyWorks application server when the instance sits in a restricted segment. And because Username and Password are optional on this form, where the direct Microsoft SQL connector requires them, it offers a path for instances that do not accept SQL Server authentication logins.

The connector is inbound only. It reads query results and writes staging tables, and it issues no writes to the source database.

NOTE: windows_only is set on this connector. The ReadyWorks ETL host that runs these jobs has to be a Windows machine with PowerShell and a SQL client available to it, and it needs network reachability to the SQL Server instance. A Linux-hosted ReadyWorks deployment cannot run this connector.

Connector Properties

Property Value
Identifier RWS_MSSQL
Name Powershell: Microsoft SQL
Description Connector for accessing Microsoft SQL database tables.
Job Types Inbound Only
Order 820
Enabled Yes
Locked Yes
Block Update No
Single Authentication No
Windows Only Yes
Connector Version 2025-12-05
Hooks None
Additional Job Fields None
Image

Authentication Methods

One method ships: a PowerShell connection to a SQL Server instance from the Windows ETL host.

Method Identifier Base Method Script Order Enabled Config Fields
Username / Password RWS_MSSQL_17bb6b78c0 RWS_MSSQL_17bb6b78c0 CX_MSSQL.ps1 10 Yes 6

NOTE: Source DB Name, Username and Password are all optional here, where the direct Microsoft SQL connector requires all three. Leaving the credentials blank means the script connects under whatever Windows identity the ETL process runs as, so confirm with your DBA which login the run actually presents and that it holds the read permissions the query needs.

NOTE: Source DB Name is stored in the auth_data_node column, which is labelled Authentication Data Node on other connectors. The value is the database name.

Method 1: Username / Password (RWS_MSSQL_17bb6b78c0)

Connect to a MS SQL Server

Username / Password runs CX_MSSQL.ps1 against the instance in Source Server on the port in Source Server Port (the default is 1433). Username, Password and Source DB Name are all optional on this form. Server Temporary Working Path is required and names the directory on the Windows host where the script stages its output.

Connection Configuration Fields (6)

Order Label Type Required Default Max Len Tooltip
10 Source Server text Yes 255 Enter name of the source server
20 Source Server Port text Yes 1433 5 Enter port number of the source server
30 Server Temporary Working Path text Yes storage/etl5 255 Enter path where temporary files are stored during data processing (exclude starting and ending backslash)
40 Username text No 1024 Tooltip for Username
50 Password password No 64000 Tooltip for Password
200 Source DB Name text No 255 Enter name of the source database

Authentication Configuration

cURL options:

Option Authentication Call Data Calls
USERAGENT Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Same
SSL_VERIFYHOST false Same
SSL_VERIFYPEER false Same
RETURNTRANSFER true Same
FOLLOWLOCATION true Same
FAILONERROR true Same

Inbound Job Fields Enabled (13)

These are the job-level settings exposed for a PowerShell Microsoft SQL extract. Data Selection holds the T-SQL statement.

Order Label Type Required Default Tooltip
10 Job Description text Yes Enter description of the Job
20 Job Schedule lookup Yes Daily Select frequency Job should run
30 Enabled radio Yes Yes Choose if Job is enabled
60 Allow Empty Table radio No Yes Choose if an empty table is allowed
70 Destination Table text Yes Enter name of the destination table
80 Data Identity text No Enter identity of the Job
90 Data Selection textarea No Enter connector specific data selection command of the Job
120 Append New Data to Existing Tables radio No No Choose if new data will append to the existing destination table, or will create a new destination table
130 Fields to Index text No Enter fields to index
150 Request Unique Key Field text No Enter request unique field key of the Job
160 Request Sort By Field text No Enter field to sort by
290 Request Limit text No Enter request limit of the Job
560 Order text Yes Enter order of the Job

Inbound Job Templates (1)

One inbound template ships. It is enabled by default and carries a placeholder query, so deal with it before the first scheduled run.

# Job Description Destination Table API End Point Enabled What It Pulls
1 MS SQL Table Data mssql_data Not set Yes A skeleton job carrying the statement SELECT * FROM {tablename} and writing to the mssql_data staging table. Replace the statement, the destination table and the data identity with your own.

Job Template Configuration

Settings

Setting Value
Order 10
Enabled Yes
Job Schedule Daily (15 1 * * *)
Destination Table mssql_data
Data Identity mssql_data
Allow Empty Table Yes
Append Files to Same Destination Table No
Append New Data to Existing Tables No
Use Unparsed Data No
Convert UUID-Keyed Objects to Rows No
Ignore XML Attributes No
Log Raw API Calls No
Method Type GET
Body Data Sending Method JSON Encoded Data

Job Parameters and Enumeration

MS SQL Table Data

Data Selection: SELECT * FROM {tablename}

Outbound Job Templates (0)

This connector ships no outbound templates and does not support outbound jobs.