Gathering Event Logs from Remote computer's should be used by Invoke-Command?
good evening,
hello, guys
acutally i’m getting error this, information servers, in variable $distributionpoints.
$distributionpoints = (get-cmdistributionpoint -sitesystemservername "*" -forcewildcardhandling).networkospath
$dpresults= $distributionpoints.trim('\\')
foreach ($dp in $dpresults) {
$filter = @{
logname = 'microsoft-windows-taskscheduler/operational'
id = 201 #"succesfully completed action of task"
data = '\microsoft\configuration manager\content validation'
}
$filter1 = @{
logname = 'microsoft-windows-taskscheduler/operational'
id = 200 #"launched action of task"
data = '\microsoft\configuration manager\content validation'
}
$a = get-winevent -filterhashtable $filter -maxevents 1
$a.timecreated
$b = get-winevent -filterhashtable $filter1 -maxevents 1
$b.timecreated
}
getting error:
et-winevent : no events found match specified selection criteria.
at line:25 char:6
+ $b = get-winevent -filterhashtable $filter1 -maxevents 1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ categoryinfo : objectnotfound: (:) [get-winevent], exception
+ fullyqualifiederrorid : nomatchingeventsfound,microsoft.powershell.commands.getwineventcommand
get-winevent : no events found match specified selection criteria.
at line:20 char:6
but got event information distributionpoints run locally?
it should used invoke-command –scriptblock {}?
i got same eror script block – invoke also.
28. august 2016 03:37:53
27. august 2016 00:00:01
ps c:\windows\system32>
you running command against local computer. $dpresults contains server name ?
get-winevent -filterhashtable $filter -maxevents 1 -computername $dp
Windows Server > Windows PowerShell
Comments
Post a Comment