Problems with a script under a scheduled task

I have a task that's triggered by a user logon event. The task runs a powershell script. I see the task being triggered in task history. The script runs some checks and sends an email. I never received the email though. Trying to find out what's going on I inserted Start-Transcript in the script. This works fine when there is an issue but when the script runs fine it doesn't log anything important. It would then indicate the script runs, yet the email isn't being sent. Is there another way to log everything the script does including successful operations? BTW when I run the script manually it sends the email. Same if I run the task under my account but if I try SYSTEM or a service account it runs without sending the email and nothing in the transcript log. 

  • Are you running the script using the verbose switch?
    Why not just add logging directly in the script?
    Did you test the script email send before your made it to the SchedTask effort?
    Unless you are using an open / unauthenticated SMTP relay server, then creds need to be supplied as well as the SMTP by name.