How to Insert Powershell output into a SQL Table

  • Hi!

    I'd like to know how to get windows events script below into a SQL Server Table. Any assistance is greatly appreciated.

    Get-WinEvent -LogName application -MaxEvents 200 | where {$_.LevelDisplayName -eq "Error"}

    Kind Regards,

    S

    ¤ §unshine ¤

  • There are a couple of cmdlets I found that are very helpful.

    Out-Datatable converts a variable into a datatable type

    Write-Datatable writes a datatable type variable to a table in SQL Server

    I don't have the original links (sorry) but Googling them should bring them up pretty quickly.


    And then again, I might be wrong ...
    David Webb

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply