3 Replies Latest reply on Aug 9, 2012 3:43 AM by John Landells

    How to get and set roles for JobSchedules?

      Hi All,

       

      I'm working on a script that backs up JobSchedules and restores them to get around the fact that there's no maintenance window functionality in BladeLogic.  However, a huge challenge that I've come up against is that when a job is scheduled, it gets executed witht he user and role that created the schedule - not the one associated with the job.  I've gone through the BLCLI docs (including the unreleased) and I can't find any way of doing this either in NSH or in Jython.

       

      Can anyone point me in the right direction, please?

       

      Many thanks,

      -John.

        • 1. Re: How to get and set roles for JobSchedules?
          Bill Robinson

          i've been trying to work out the same thing, and hit the same issue.  if you can extract the role that scheduled it, you would need to use the 'assumeRole' command to change to the other role before setting the schedule.

           

           

          bsa does have maintance windows though - the ACL Policy object has a time window on it, and that will grant access to run jobs on target servers for certian roles during certain times - have you looked at that ?

          • 2. Re: How to get and set roles for JobSchedules?

            Hi Bill,

             

            I've been doing some more testing and found out that the scheduled jobs are run by the user/role that LAST MODIFIED the schedule, which can easily be retrieved when backing up the scedule meta.  When replacing the schedules, my plan was to batch up all the schedules per role, then simply switch role in Jython (and reconnect) then create the relevant schedules. 

             

            The one confusing thing that might catch you out for a while is that in the Job Schedules pane in CM, the schedules are listed with the user/role that created them - not the ones that will be used to execute them!  I've asked for an RFE to be raised to change this, but we'll have to wait and see what happens.

             

            -John.

            • 3. Re: How to get and set roles for JobSchedules?

              FYI - the RFE for the change to the console view is #QM001763505.

               

              -John.