Files
sql-server-samples/samples/manage/sql-assessment-api/docs/How-To/UsingNonSQLProbes.md
T
Aleksei Guzev 0c5f2ef62a Update SQL Assessment API docs
- Fix image references
- Add target pattern page
- Add message template page
2022-09-30 00:22:05 +03:00

2.0 KiB

Retrieving Data from Operating System

In the SQL Assessment API, most of the probes use T-SQL to get data for assessment. However, there are probes that obtain data from the operating system not presented in SQL Server dynamic management views. In order for these probes to get data, the xp_cmdshell stored procedure and PowerShell access should be enabled on the target SQL Server. While these facilities are disabled, some checks may be skipped.

Keep in mind that the xp_cmdshell stored procedure should be enabled temporarily as it is not recommended by the best practices; once you complete the assessment, make sure to disable it.

The following steps are required to enable xp_cmdshell and PowerShell:

  1. Enable the xp_cmdshell stored procedure to work with T-SQL queries, as described in xp_cmdshell configuration option.

  2. Enable SQL Server PowerShell on the target SQL server, as described in SQL Server PowerShell.

  3. Make sure that the SQL Server user has access to the xp_cmdshell stored procedure. For more information, see xp_cmdshell (Transact-SQL).

  4. Perform assessment.

  5. Disable the xp_cmdshell stored procedure by executing the following T-SQL query on the target SQL Server.

    EXECUTE sp_configure 'xp_cmdshell', 0;
    RECONFIGURE