Skip to main content
All CollectionsMigratePowerShellTips and tricks
Schedule your PowerShell migration
Schedule your PowerShell migration
Updated this week

You can use Task Scheduler in Windows to run PowerShell scripts periodically or outside business hours.

Note: While you can schedule a migration script to run while logged off Windows, it will not work with the Browser authentication method since it requires you to enter your username and password in a browser window when you run your script.

Index

Save your script as a .ps1 file

To use Task Scheduler, you will need your script in a .PS1 file format.

You can use Windows PowerShell ISE to create scripts in that format.

If you use Notepad or another plain text editor to create your scripts, you can save them as a .txt format and change the extension to .ps1 in Windows afterward.

Note: You have to import the ShareGate Migrate module in your script for the scheduling to work.

Create a scheduled task

  1. Open Task Scheduler in Windows.

  2. Select Create Task... in the Actions panel to the right.

  3. Give the new task a name and description.

  4. Set your security settings.

    mceclip2.png


    Note: The user account you use must be the same one licensed in ShareGate Migrate.

  5. Select the Triggers tab.

  6. Click New...

  7. Set the scheduling options.
    Note: make sure Enabled is checked at the bottom.

    mceclip3.png
  8. Click OK.

  9. Select the Actions tab.

  10. Click New...

  11. Type Powershell.exe in the Program/script field.

  12. Type the file path of your script in the Add arguments field.

    mceclip4.png
  13. Click OK.

  14. Review and modify the options in the Conditions and Settings tabs as needed.

  15. Click OK.

Did this answer your question?