Powershell script does not run via Scheduled Tasks

后端 未结 18 878
南方客
南方客 2020-12-02 23:12

I have a small script on my Domain Controller that is setup to email me via SMTP about the latest Security Event 4740.

The script, when executed manually, will run a

18条回答
  •  情深已故
    2020-12-02 23:25

    In my case it was related to a .ps1 referral inside the ps1 script which was not signed (you need to unblock it at the file properties) , also I added as first line:

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

    Then it worked

提交回复
热议问题