4 Replies Latest reply on May 10, 2018 6:04 AM by samurainigel

    Mass scheduling of tasks.

    samurainigel Apprentice

      Looked around for a while and couldn't find an answer for this one:


      I have about 200 tasks in a single group in my Scheduled Tasks tab. Each task is associated with its own query for specific computers. I need to get all 200 of these scheduled to run once per week at a specific time of day.


      Is there a faster way to schedule them all at once with the same schedule than going to the properties of each one by hand and scheduling them one-by-one?



        • 1. Re: Mass scheduling of tasks.
          LANDeskWizrd SSMMVPGroup

          Technically there is. It is not the most intuitive way of doing it but I use the MBSDK to loop through all the task_idn's for a particular Owner, in your case you would use a group. It works very well and I can kick off over 200 tasks whenever I decide to. Aside from using the MBSDK, the only other way I can see it being done is to write directly to the DB and set a start time, in the future, for all the tasks in your group.

          • 2. Re: Mass scheduling of tasks.
            samurainigel Apprentice

            Yeah, option two was where I was thinking of going, but I try not to write directly to our production database if I can avoid it.


            I did find a way to do this which wasn't much cleaner, but did work:


            • I modified one of the scheduled tasks how I wanted it to be (10am weekly, every Wednesday) and saved the task.
            • Exported the modified task to an .ldms file.
            • Exported the group which contained the 200 tasks I needed to edit. This created one big .ldms file with all of the data in it. I originally was expecting it to create a bunch of .ldms files like when you export a bunch of distribution packages, but for some reason, it does it all as one great, big file instead.
            • From there, I looked at the "corrected" .ldms file, and compared it to the first entry in the big .ldms file in Notepad++. I found the relevant rows that were changed in the scheduled version of the task, then used find/replace to change all of scheduled tasks in the big file to match. (This ended up being easier than the powershell script I thought I was going to have to write to open each .ldms file, search for the rows I wanted changed, modify them, and save the .ldms file!)
            • These rows were:
              • initialStart
              • timeNextStart
              • timeLastStart
              • weekFlags
              • taskStatus
            • Imported the large .ldms file to update the existing scheduled tasks.


            Note: The "taskStatus" row I kind of found through trial and error. Apparently EPM changes the task status to "HOLD" when you export a task, even if it's an active task. Then when you re-import the .ldms file, you end up with a Status of "Not Scheduled." I manually changed the taskStatus to "WAITING" on all scheduled tasks before importing, which set the status of each task to Waiting, instead of Not Scheduled.

            • 3. Re: Mass scheduling of tasks.
              phoffmann SupportEmployee

              There's technically another way to do it, but that's about to change with 2018 ... so I'll second the vote to make use of MBSDK & such as better ways (that should work through back-end tech changes).


              For more info on using the MBSDK , see here -- Getting Started with the MBSDK (Example Scripts Included) .

              • 4. Re: Mass scheduling of tasks.
                samurainigel Apprentice

                Thank you both for the help. I'll look into doing it that way the next time I'm looking at this. I never even knew about MBSDK before this thread. It looks pretty useful.