Related Pages:


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:

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

In this section