Enforce Maintenance Window with Client Locking
Log In or Register to download the BES file, and more.

0 Votes

Description

This task will enforce the designated maintenance window on an endpoint by unlocking it during its maintenance window, and locking it at all other times.

The first action with it's default settings will set up a policy action that will unlock a client at the beginning of the last maintenance window and lock a client at the end of the last maintenance window.

Note that this task will override any previous locking/unlocking actions for the selected computers. Similarly, any locking/unlocking actions taken on the selected computers at a later time will override this action (you will need to re-take this task in this case)


Property Details

ID302
TitleEnforce Maintenance Window with Client Locking
CategoryMaintenance Window
Download Size0
SourceBigFix
Source ID<Unspecified>
Source Severity<Unspecified>
CVENamesN/A
KeywordsMaintenance Window TABLE TBODY maintenance
Added by on 10/17/2012 1:14:45 PM
Last Modified by on 10/17/2012 1:14:45 PM
Counters 5586 Views / 5 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 2 fixlets and 1 analsis   * Results in a true/false
Show indented relevance
exists settings whose(name of it = "MaintenanceWindow_StartTime" AND exists value of it) of client
Used in 1 fixlet   * Results in a true/false
Show indented relevance
((now > item 1 of it) AND (if (item 0 of it = "once") then ((item 1 of it & item 2 of it)) else if (item 0 of it = "daily") then ((item 1 of it + ((now - item 1 of it) / day / item 3 of it * (day * item 3 of it))) & item 2 of it) else if (item 0 of it = "weekly") then (it & ((value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer) * minute)) of (maximum of (it - 1*day; it - 2*day; it - 3*day; it - 4*day; it - 5*day; it -6 * day;it; it + 1*day; it + 2*day;it + 3*day;it + 4*day;it + 5*day;it + 6*day) whose (it < now AND (((value of setting "MaintenanceWindow_DaysOfWeek" of client as string as lowercase)) contains (first 3 of (it as string) as day_of_week as string as lowercase))) of (((current date - item 0 of it) / (item 3 of it * week) * (item 3 of it * week)) + item 0 of it & item 1 of it) of ((((date (local time zone) of item 1 of it - ((first 3 of (item 1 of it as string) as day_of_week) - sunday))) , time (local time zone) of item 1 of it, item 2 of it, item 3 of it))) else if (item 0 of it = "monthly") then (it & (value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer * minute)) of ((if (item 3 of it = 0) then (maximum of ((if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of (current month & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of (current month & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing) ; (if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (if (current month as integer = 1) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & ((current year) - 1* year)) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else ((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing) ; (if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (if (current month as integer = 1) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & ((current year) - 1* year)) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else ((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing)) whose (it < now)) else (maximum of ((if exists ((current month & (day_of_month (item 3 of it)))) then (((current month & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing) ; (if exists (((current month - 1* month) & (day_of_month (item 3 of it)))) then (if (current month as integer = 1) then ((((current month - 1*month) & (day_of_month (item 3 of it))) & (current year - 1*year)) & time (local time zone) of item 1 of it) else (((current month - 1*month) & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing) ; (if exists (((current month - 2*month) & (day_of_month (item 3 of it)))) then (if (current month as integer = 1) then ((((current month - 2*month) & (day_of_month (item 3 of it))) & (current year - 1*year)) & time (local time zone) of item 1 of it) else (((current month - 2*month) & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing)) whose (it < now)))) else error "invalid maintenance type") contains now) of (value of setting "MaintenanceWindow_RepeatType" of client, (value of setting "MaintenanceWindow_StartTime" of client & " " & local time zone as string) as time, (value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer) * minute, value of setting "MaintenanceWindow_RepeatInterval" of client as integer) = value of setting "__Lockstate" of client as boolean
Used in 1 fixlet   * Results in a true/false
Show indented relevance
now > (value of setting "MaintenanceWindow_StartTime" of client & " " & local time zone as string) as time

Actions

Action 1 (default)

Action Link Click here to use locking to enforce the maintenance window.
Script Type BigFix Action Script
setting "MaintenanceWindow_TimesRun"="{value of setting "MaintenanceWindow_TimesRun" of client as integer +1}" on "{parameter "action issue date" of action}" for client
if {((now > item 1 of it) AND (if (item 0 of it = "once") then ((item 1 of it & item 2 of it)) else if (item 0 of it = "daily") then ((item 1 of it + ((now - item 1 of it) / day / item 3 of it * (day * item 3 of it))) & item 2 of it) else if (item 0 of it = "weekly") then (it & ((value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer) * minute)) of (maximum of (it - 1*day; it - 2*day; it - 3*day; it - 4*day; it - 5*day; it -6 * day;it; it + 1*day; it + 2*day;it + 3*day;it + 4*day;it + 5*day;it + 6*day) whose (it < now AND (((value of setting "MaintenanceWindow_DaysOfWeek" of client as string as lowercase)) contains (first 3 of (it as string) as day_of_week as string as lowercase))) of (((current date - item 0 of it) / (item 3 of it * week) * (item 3 of it * week)) + item 0 of it & item 1 of it) of ((((date (local time zone) of item 1 of it - ((first 3 of (item 1 of it as string) as day_of_week) - sunday))) , time (local time zone) of item 1 of it, item 2 of it, item 3 of it))) else if (item 0 of it = "monthly") then (it & (value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer * minute)) of ((if (item 3 of it = 0) then (maximum of ((if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of (current month & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of (current month & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing) ; (if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (if (current month as integer = 1) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & ((current year) - 1* year)) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else ((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - month) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing) ; (if exists (first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week)) then (if (current month as integer = 1) then (((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & ((current year) - 1* year)) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else ((first (value of setting "MaintenanceWindow_DaysOfWeek" of client as day_of_week) of ((current month - (2*month)) & current year) + ((value of setting "MaintenanceWindow_DayOrdinal" of client as integer - 1) * week))) & time (local time zone) of item 1 of it) else nothing)) whose (it < now)) else (maximum of ((if exists ((current month & (day_of_month (item 3 of it)))) then (((current month & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing) ; (if exists (((current month - 1* month) & (day_of_month (item 3 of it)))) then (if (current month as integer = 1) then ((((current month - 1*month) & (day_of_month (item 3 of it))) & (current year - 1*year)) & time (local time zone) of item 1 of it) else (((current month - 1*month) & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing) ; (if exists (((current month - 2*month) & (day_of_month (item 3 of it)))) then (if (current month as integer = 1) then ((((current month - 2*month) & (day_of_month (item 3 of it))) & (current year - 1*year)) & time (local time zone) of item 1 of it) else (((current month - 2*month) & (day_of_month (item 3 of it))) & current year) & time (local time zone) of item 1 of it) else nothing)) whose (it < now)))) else error "invalid maintenance type") contains now) of (value of setting "MaintenanceWindow_RepeatType" of client, (value of setting "MaintenanceWindow_StartTime" of client & " " & local time zone as string) as time, (value of setting "MaintenanceWindow_WindowSizeMinutes" of client as integer) * minute, value of setting "MaintenanceWindow_RepeatInterval" of client as integer)}
action unlock "{(parameter "action issue date" of action as time) + (value of setting "MaintenanceWindow_TimesRun" of client as integer * second)}"
else
action lock indefinite "{(parameter "action issue date" of action as time) + (value of setting "MaintenanceWindow_TimesRun" of client as integer * second)}"
endif
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!