Powershell script to create scheduled tasks from csv file

Posted by Rihan Meij on Stack Overflow See other posts from Stack Overflow or by Rihan Meij
Published on 2010-06-02T06:51:37Z Indexed on 2010/06/02 6:53 UTC
Read the original article Hit count: 583

Filed under:
|

I would like to use Powershell to create a couple of scheduled tasks, on a server. I have created the file from existing schedule's

I have loaded up the csv file, piped it to a select, and retreived all the info that I require from the csv file. However I am not sure on how to pass these results on to a external non powershell command.

Import-Csv .\listoftasks.csv | Select 'Run As User','RP','Scheduled Type','TaskName','Task To Run','Repeat: Every','Repeat: Until: Duration' 

What I would like to do is something like:

Import-Csv .\listoftasks.csv | Select 'Run As User','RP','Scheduled Type','TaskName','Task To Run','Repeat: Every','Repeat: Until: Duration' | schtasks /create /RU ....

© Stack Overflow or respective owner

Related posts about powershell

Related posts about scheduled-tasks