this ps script can use to set when a event trigger and email notify to specific user. example: when a remote desktop connection stablished to a server email to admin.
you must set email smtp server and credentials and email for notification; and event ID for event trigger.