Reading Application Event log to a remote computer

  • HI Guys

    I have a remote server where I dont have RDP access.

    I opened Powershell and wrote the below query to read some of the message, but getting error:-

    Clear-Host

    $Machine = "XXXXX"

    #Get-Eventlog -Logname System -ComputerName $Machine -newest 1000 | Where-Object {$_.EventID -lt '100'} |

    Error Message:

    [XXXXX] Connecting to remote server XXXXX failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the

    WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.

    + CategoryInfo : OpenError: (XXXXX:String) [], PSRemotingTransportException

    + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken

    Can you please suggest how to read the data (app/system eventviewerlog) using xp_cmdshell from SQL Server Mgmt studio itself?

    Have a great weekend.....to all of you!!!

    Thanks.

  • The error gives you the problem. You need features enabled on the remote machine.

    SQL Server is an application that runs inside Windows. As such, it doesn't have access to things on the host directly, like the Event log. You can put code that can help, as described here: http://www.mssqltips.com/sqlservertip/1915/how-to-automatically-monitor-windows-event-log-from-sql-server/

    Really, the best thing is to get your admins to allow you access. Then you can use Windows on your machine and open the event logs from remote machines.

    https://technet.microsoft.com/en-us/library/cc766438.aspx

  • You could also use the Log File Viewer in SSMS to read Windows events. Just open the SQL Server Logs and in the left pane there is an option for Windows NT.

    https://msdn.microsoft.com/en-us/library/dd206998.aspx

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

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