Skip to main content
Skip table of contents

Running PowerShell Script from Scheduler

Related Pages:

Example:

To call the .ps1 script AD_Runner.ps1

For both Microsoft Task Scheduler and SQL Server Agent use:

powershell -file “<path>\AD_Runner.ps1”

  • Replace <path> with the full path to AD_Runner.ps1

In SQL Server Agent:

Step tab:

  • Type: Operating System (CmdExec)

  • Call the Powershell script with:
    powershell -file “ ... \AD_Runner.ps1”

Opening PowerShell if the powershell Shortcut Doesn't Work

In the examples powershell calls a standard Windows shortcut. On Windows systems the shortcuts installed by Windows call:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

Find the powershell.exe file and use the entire path & file name.

In this section

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.