I've created numerous scripts in Powershell that are working as intended if I execute them directly, however, when I try and setup a schedule to run these in Task Scheduler (to run with highest prilavages) it doesn't seem to be running anything at all.
I'm running the following in my actions:
powershell.exe -ExecutionPolicy Bypass -File C:\PS\Mailboxes\CheckForwardingList.ps1
I'm getting a "Last Run Result" of 0x0 and the particular purpose of the above script is to generate a TXT file from EXO which it then mails out via SMTP and I've yet to receive any emails and I also don't see any TXT being generated in the folder where the script is located.
I do have two additional scripts setup which aren't running but once I've addressed the issue on the above this should quickly rectify the problems.
Extremely appreciative if people could point me in the right direction here? feels like I'm going in circles with something that from what I can tell should be working?
Many thanks