Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Takes forever to pass the output

$
0
0

Is there anything wrong with these codes? I am trying to list the event ID 1074. It runs well locally but not on the remote pc. It takes more than 10 mins.

Function whoshutdown($ComputerName = ".")
{
$date=(Get-Date).AddDays(-7)

Get-Eventlog -Logname System -computer $ComputerName -After $date `
| Where-Object {$_.EventId -eq ’1074′} `
| Format-list  TimeWritten,EventID, Message | more
}



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>