Change User's Schedule Script

Is there any way to change a user’s schedule via a script?
We have multiple schedules and I would like to change this schedule via a script for a user but can’t find any way to do it.

Any ideas?

You mean like by using system.user.editSchedule()?

No, that edits a schedule, I want to edit a user’s schedule.

Ok, for that I think you’ll have to use a combination of system.user.getUser() and system.user.editUser(). I believe you are going to have to dig into the PyUser class to make it work. I can’t test it right now but I know you can do a get on the ‘schedule’ property, you should also be able to do a set on it to change the users schedule. It would be similar to the example in the editUser() function but instead of adding contact info like shown, you would use the .set() function described in PyUser to set your ‘schedule’ property.

Unfortuanlely the system.user.editUser() is not available in 7.9 which I am using.

Hi ,I know this is an old post but has anyone found out how to modify a user schedule with a script?
I looked in the PyUser class but there is no specific function to modify a user’s schedule.

if it is a database profile you can edit it in the database.