Begin
Run the task scheduler and select create a task.
General Tab
Configure the Name, Run whether the users is logged on or not, and Configure for Windows 10. If the script needs to run as an administrator, check run with highest privileges. Occasionally, the option to run whether the user is logged on or not, will not work. In that event, you may need to run the script with elevated permissions or as another user.
Triggers Tab
Select to run once a day, the start time, and verify the task is actually enabled.
Action Tab
The script must be stored under the local user’s profile to get it to execute!! i.e. C:\users\username\tasks\yourscript.ps1.
Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Argument: -nologo -windowstyle Hidden -file C:\Users\user1\scripts\report.ps1
Common PS arguments are -NoProfile meaning do not load the users profile (use when you have custom setting in the script), -executionPolicy Bypass means allow the script to run with no conditions (i.e. it is not signed), -Windowstyle Hidden states to not display the PS window, and -nologo means to suppress the PowerShell copyright information when PS starts up (provides a cleaner process).
Conditions Tab
Make no changes.
Settings Tab
Make no changes. Do not enable “if task fails. then restart”. If your password expires, it will keep locking your AD account.