Syncing Scheduled Tasks with Powershell
Tue, Jan 10, 2012The following script will allow you to sync scheduled tasks to a local server from a remote one. You can modify the source and target folders, and that’s good because this script will wipe out the target folder (the one on the local host) every time it’s run. Of course you could change that behavior easily. I keep this scheduled task running in the root of scheduled tasks and it’s never removed. You could choose to sync the root folder, and use a where clause to make sure you protect certain tasks.
This script also imports the scheduled tasks as disabled. I’m using this for a failover server, so I want them off. you can fix that by removing the .replace(“str”,”newstr”) chunk.
Enjoy!
`The following script will allow you to sync scheduled tasks to a local server from a remote one. You can modify the source and target folders, and that’s good because this script will wipe out the target folder (the one on the local host) every time it’s run. Of course you could change that behavior easily. I keep this scheduled task running in the root of scheduled tasks and it’s never removed. You could choose to sync the root folder, and use a where clause to make sure you protect certain tasks.
This script also imports the scheduled tasks as disabled. I’m using this for a failover server, so I want them off. you can fix that by removing the .replace(“str”,”newstr”) chunk.
Enjoy!
`