SetApplicableHour

Sets a day and hour of the week for which the role is active or inactive.

Syntax

void SetApplicableHour(int dayOfWeek, int hourOfDay, bool isApplicable)

Parameter

Specify the following parameters when using this method.

Parameter Description

dayOfWeek

The day of the week on which you want the role to be active or inactive, where 0 is Sunday and 6 is Saturday.

hourOfDay

The hour of the day at which you want the role to be active or inactive, where 0 is midnight and 23 is 11:00 PM

isApplicable

Set true to make the role active on the specified day and hour, or false to make the role inactive.

Discussion

If you set the role active on Monday at 10 AM, it is active every Monday from 10:00 to 10:59. To set an entire day, see GetSshRight. To set up an entire schedule with one call, see ApplicableTimeHexString. To check whether the role is active at a given time, see IsApplicable.

Changes to the role assignments are not stored in Active Directory until you call the Commitmethod.