Chat now with support
Chat with Support

LiteSpeed for SQL Server 8.9.5 - Security and Compliance Guide

Log Reader - PowerShell Snap-In

The Log Reader provides a Snap-In to extend Windows PowerShell sets of commands with the Log Reader commands. For more information, see Log Reader Command-Line Interface Commands.

To use a Snap-In, you must add the Snap-In to the PowerShell console for every Windows PowerShell session, or you can start PowerShell from a previously created configuration file so that sessions will already include the Snap-In.

TIPS:

  • 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.
  • You can see the current PowerShell version using the PowerShell console. Command: $PSVersionTable.PSVersion.

  • To register your dll, the Powershell should be run with the“Run as Administrator” option (for Vista and later).

  • To run individual versions of the console, register the PowerShell (x86) 32-bit or the 64-bit version. If you want to work with both the 32-bit and the 64-bit version of PowerShell, run the registration for each one.


To register Log Reader Snap-In

Use the following command to run the registration script supplied with your Log Reader installation package:

  1. Run Windows PowerShell.
  2. Run the following command:

    . "LRInstallationDirectory\LogReader.SqlServer.register.ps1"

    where

    LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server\Toad for SQL Server x.x\Plugins\SqlServer\LogReader).

To register the Log Reader Snap-In

  1. Run Windows PowerShell.
  2. Run the following command(s).

    For PowerShell 64-bit (easy method):

    LogReader.SqlServer.register.ps1

    This script is located in C:\Program Files\Quest Software\LiteSpeed\SQL Server

    The script automatically finds the LiteSpeed installation folder and calls installutil for LogReader.SqlServer.PSSnapIn.dll.

     

    For PowerShell 64-bit (original method):

    set-alias installutil $env:windir\Microsoft.NET\Framework64\v4.0.30319\installutil.exe

    installutil "LRInstallationDirectory\LogReader.SqlServer.PSSnapIn.dll"

    where

    LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server\Toad for SQL Server x.x\Plugins\SqlServer\LogReader).

     

    For PowerShell (x86) 32-bit:

    set-alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\installutil.exe

    installutil "LRInstallationDirectory\LogReader.SqlServer.PSSnapIn.dll"

    where

    LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server\Toad for SQL Server x.x\Plugins\SqlServer\LogReader).

To add the Log Reader Snap-In to the PowerShell console

  1. Run Windows PowerShell.
  2. Verify that the Log Reader Snap-In is registered by running the following command:

    Get-PSSnapIn -registered

    Windows PowerShell displays Snap-Ins that are available in the session.

  3. Check that the LogReader.SqlServer Snap-In is in the list. If not, register the Snap-In. For more information, see To register the Log Reader Snap-In.
  4. Run the following command:

    add-pssnapin LogReader.SqlServer

  5. (First use only) You may need to register the data formatting file using the following command:

    Update-FormatData -AppendPath "LRInstallationDirectory\LogReader.SqlServer.Format.ps1xml"

    where

    LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server\Toad for SQL Server x.x\Plugins\SqlServer\LogReader).

To save PowerShell console configuration

  1. Run Windows PowerShell.
  2. Add the Log Reader Snap-In to the current PowerShell console. For more information, see To add the Log Reader Snap-In to the PowerShell console.
  3. Run the following command:

    export-console MyCustomShell

    where

    MyCustomShell is the name of a console file where to save configuration.

    Windows PowerShell creates a MyCustomShell.psc1 console file in the current directory that identifies the Snap-In to load when the shell starts.

To start PowerShell from a saved configuration

Run the following command:

%ProgramFiles%\Command Shell> PS - PSConsoleFile MyCustomShell.psc1

where

%ProgramFiles% is an environment variable with the path to your Program Files directory (usually, C:\Program Files), and

MyCustomShell.psc1 is a PowerShell console configuration file.

 

Related Topics

About Using the Log Reader Command-Line Interface

Log Reader Command-Line Interface Commands

Script Log Reader Commands

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating