Relative Content

Tag Archive for powershellwindows-task-scheduler

Why does my script’s output change when run manually vs via task scheduler

While my script runs both ways, when run through task scheduler, it messes up on an if-else statement. It’s supposed to send out an email when it detects that there are fewer than three objects in a directory and creates a pdf with letters for patients when there are three or more files in that directory (two folders and a variable amount of patient data files). The issue that I’m running into is that when it’s running through task scheduler, it creates a blank pdf when there’s no patient data instead of sending out the email. Has anyone else run into similar issues?

How to invoke a script with admin rights through another script

My company is in the process of reorganizing all windows scheduler tasks that utilize PowerShell scripts. For security reasons, we are no longer allowed to use an admin domain account to call the scheduler tasks directly. However, some scripts require admin domain rights to perform their tasks.