Chat now with support
Chat with Support

LiteSpeed for SQL Server 8.9.5 - Security and Compliance Guide

Log Reader - Script CLI commands

You can script most frequently used commands of the Log Reader command-line interface and execute scripts directly in a PowerShell console.

Tip: To create a CLI script for the Log Reader, enter the script in a word processor and save it as a .ps1 file.

To execute a Log Reader CLI script

In PowerShell, execute the following command:
 & [Path]

where Path is path to the script.

To schedule Log Reader CLI script execution

  1. Use Job Manager to create a new Windows task.
  2. In the Run field, enter the following command:

    "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -PSConsoleFile LogReaderSnapIn.psc1 -Command ". script.ps1

    where

    %SystemRoot% is an environment variable with the path to your system root directory (usually, C:\WINDOWS),

    LogReaderSnapIn.psc1 is the full path to a previously saved PowerShell console configuration file and script.ps1 is the full path to a script file. For more information, see To save PowerShell console configuration.

Troubleshooting: If you receive a "File [path] cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details." error, run the "Set-ExecutionPolicy RemoteSigned" command to disable security restrictions and execute the script again.

 

Related Topics

Log Reader PowerShell Snap-In

Log Reader Command-Line Interface Commands

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating