Task Scheduler - Task triggered on an event not running when the event is added to the event log


hi there,

i'm testing setup of email alert when storagespaces reports event.

the server os is ws2012r2 essentials experience.

i've create custom task run whether user logged or not , highest privileges. user account member of local administrators group. local administrators group has log on batch job privilege.

the custom task set trigger on event (critical, error, warning or information) microsoft-windows-storagespaces-driver/operational event log.

the custom task set send email using 32bit version of powershell following parameters <<-executionpolicy bypass -command "& {send-mailmessage -from xxx -to xxx -subject 'storagespaces alert' -body 'alert' -smtpserver xxx}">>

this task never runs when new event logged in targeted event log. there no event in task history beside task registration events.

i followed task scheduler troubleshooter , checks out. task enabled. no special condition. user account should allowed.

i also created same task event viewer , task doesn't run either.

what doing wrong?

please help.

additional information:

the server domain controller.

also, the tasks created using remote desktop connection server.

hi dave,

i think figured out problem.

the objective of alerting task report storagespaces errors , warnings. server is using new drives. therefore, don't have errors , warnings yet. test task scheduler script, decided trigger on information events, since few of these events are registered every once in while. on last few days got few, task never triggered. noticed 1 of event coincided server reboot. after analysis, realized storagespaces information events far registered during server boot time, before task scheduler. that's why task never triggered.

during search answer, i landed on jose barreto's blog presents sophisticated powershell script test storage cluster health. here link:

https://gallery.technet.microsoft.com/scriptcenter/test-storagehealthps1-66d84fd4

the script robust , thorough. however, complex single server. modified for a single server , add send email option. i'm no powershell , html expert, managed create workable script. i'll use task scheduler run script every 30 minutes , send email if storage unhealthy.

i wouldn't mind sharing script, don't see option add attachment thread.

let me know if interested.

thanks again help.



Windows Server  >  Windows Server General Forum



Comments

Popular posts from this blog

DCOM received error "2147746132" from...

DFSR RPC replication errors 5014 1726 with large files over VPN

ADFS 3.0 Event ID 4625 | An Error occurred During Logon | Status: 0xC000035B