I have a script that is reset password of the user.
I want to run it use task scheduler every hour once.
But is failed.
The history of scheduler show the task completed.
but the script don't have any out.
This is my action set
I have a script that is reset password of the user.
I want to run it use task scheduler every hour once.
But is failed.
The history of scheduler show the task completed.
but the script don't have any out.
This is my action set
Hi,
if you are able to run the script manually with the same parameters as specified on the scheduled task, then most probably you need to reconfigure the task in a proper way. Can you please verify this. Here is a nice guide to use as a reference:
How to Schedule PowerShell Script using Task Scheduler
https://o365reports.com/2019/08/02/schedule-powershell-script-task-scheduler/
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
Thanks and Regards,
Stoyan
Hi,
Task completed does not mean the script has been executed successfully. Can you run the script manually?
Best Regards,
Ian
Hi,
In this case it‘s not a powershell issue. Please check the OS version and add the corresponding tag.
Best Regards,
Ian
Add the Start-Transcript and Stop-Transcript commands to your script and see if it encounters an error.
powershell-transcript-record-a-session-to-a-text-file
Several points to troubleshoot:
To confirm if PowerShell command is able to execute and check the results, open a D.O.S. session (cmd.exe) and execute the command and parameters registered on the Scheduled task.
i.e
powershell.exe -file "c:\temp\hello.ps1"
C:\Temp>powershell.exe -file "c:\temp\hello.ps1"
Once is confirmed executing correctly try again with the schedule.
In order to have more feedback you can use Start-Transcript / Stop-Transcript commands to log any execution details on a Log file.
Confirm the resources used by your script, for instance if you are using network resources you will need your schedule task to be logged as an user to work.
I don't know if you ever figured it out but from the look of your screenshot you have a forward slash in your arguments for the file path. Windows file paths use backslashes.
6 people are following this question.