How do I execute a PowerShell script automatically using Windows task scheduler?

后端 未结 9 1732
甜味超标
甜味超标 2020-11-29 23:24

I have one PowerShell script which sends emails. I want to execute that script automatically, every 1 minute. How can I do it, using task scheduler?

Currently I have

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 00:14

    1. Open the created task scheduler

    2. switch to the “Action” tab and select your created “Action”

    3. In the Edit section, using the browser you could select powershell.exe in your system32\WindowsPowerShell\v1.0 folder.

         Example -C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      
    4. Next, in the ‘Add arguments’ -File parameter, paste your script file path in your system.

          Example – c:\GetMFAStatus.ps1
      

    This blog might help you to automate your Powershell scripts with windows task scheduler

提交回复
热议问题