How to best automate running the sync365.ps1 powershell script.
Once you have created the sync365.ps1 script you will want to save a backup of those .csv files in case you have a problem later.
These instructions are based on a Windows 2008 R2 server, but the same concepts apply to Windows 2012.
Create a New Task
On the General tab, give it a name; and, for the description, you may want it read something like "Retain address book synchronization script for Office365".
Under "Security options" section, choose: âRun whether user is logged in or notâ.
Under the Triggers tab, click on "New..."
Under "Settings", set it to "Daily" and set the "Start" time : [set it to run an hour before the archive job is set to begin, but it doesnât take that long, Exchange does maintenance between 1-5 AM]
Do not expire
Under the Actions tab: Create a New action.
- Set the Action to âStart a programâ
- Program/script: powershell
- Add arguments: -NoProfile -ExecutionPolicy Bypass -file "[drive]:\Program Files\Beginfinite\Retain\RetainServer\WEB_INF\cfg\sync365.ps1" -Verb RunAs
- Start In: (left blank)
If you create it at the Task Scheduler (Local) level you will be able to find it in the Task Scheduler Library folder after it is created, in the center pane.