lunes, 15 de diciembre de 2014

How Get Events of Task Scheduler using Powershell

Hi script guys!

For today I have a simple script to collect events of task scheduler.
It is very easy and I think practice some times, because we can have several tasks scheduled in a system and review if they are working fine it is not funny .... :-(

enjoy it!!!


<# =======================================================================

File Name: GetEventsTaskScheduler_v01.ps1

Author: citrixpedia@gmail.com
Date: 9-dic-2014

Comments: Script to get all events of task scheduler and outpu to text file


======================================================================= #>


#-------------------------------------

# Get Location of script
#-------------------------------------

Get-Location | ForEach-Object { $myPath = $_.Path }


$outputfile= $myPath + "\EventsTaskSchedule.log"


#-------------------------------------

# Get Events
#-------------------------------------

get-winevent -LogName 'Microsoft-Windows-TaskScheduler/Operational' | Where-Object { $_.LevelDisplayName -match "Error" } | fl LevelDisplayName, TimeCreated, OpcodeDisplayName, TaskDisplayName, MachineName, Message | Out-File -Encoding ascii $outputfile


No hay comentarios:

Publicar un comentario