( ( now > item 1ofit ) AND ( if ( item 0ofit="once" ) then ( ( item 1ofit & item 2ofit ) ) elseif ( item 0ofit="daily" ) then ( ( item 1ofit + ( ( now - item 1ofit ) / day / item 3ofit * ( day * item 3ofit ) ) ) & item 2ofit ) elseif ( item 0ofit="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 3of ( itas string ) as day_of_week as string as lowercase ) ) ) of ( ( ( current date - item 0ofit ) / ( item 3ofit * week ) * ( item 3ofit * week ) ) + item 0ofit & item 1ofit ) of ( ( ( ( date ( local time zone ) of item 1ofit - ( ( first 3of ( item 1ofitas string ) as day_of_week ) - sunday ) ) ) , time ( local time zone ) of item 1of it, item 2of it, item 3ofit ) ) ) elseif ( item 0ofit="monthly" ) then ( it & ( value of setting "MaintenanceWindow_WindowSizeMinutes"of client as integer * minute ) ) of ( ( if ( item 3ofit=0 ) then ( maximum of ( ( ifexists ( 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 1ofit ) else nothing ) ; ( ifexists ( 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 1ofit ) 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 1ofit ) else nothing ) ; ( ifexists ( 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 1ofit ) 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 1ofit ) else nothing ) ) whose ( it < now ) ) else ( maximum of ( ( ifexists ( ( current month & ( day_of_month ( item 3ofit ) ) ) ) then ( ( ( current month & ( day_of_month ( item 3ofit ) ) ) & current year ) & time ( local time zone ) of item 1ofit ) else nothing ) ; ( ifexists ( ( ( current month - 1* month ) & ( day_of_month ( item 3ofit ) ) ) ) then ( if ( current month as integer =1 ) then ( ( ( ( current month - 1*month ) & ( day_of_month ( item 3ofit ) ) ) & ( current year - 1*year ) ) & time ( local time zone ) of item 1ofit ) else ( ( ( current month - 1*month ) & ( day_of_month ( item 3ofit ) ) ) & current year ) & time ( local time zone ) of item 1ofit ) else nothing ) ; ( ifexists ( ( ( current month - 2*month ) & ( day_of_month ( item 3ofit ) ) ) ) then ( if ( current month as integer =1 ) then ( ( ( ( current month - 2*month ) & ( day_of_month ( item 3ofit ) ) ) & ( current year - 1*year ) ) & time ( local time zone ) of item 1ofit ) else ( ( ( current month - 2*month ) & ( day_of_month ( item 3ofit ) ) ) & current year ) & time ( local time zone ) of item 1ofit ) 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
((now > item 1ofit) AND (if (item 0ofit="once") then ((item 1ofit & item 2ofit)) elseif (item 0ofit="daily") then ((item 1ofit + ((now - item 1ofit) / day / item 3ofit * (day * item 3ofit))) & item 2ofit) elseif (item 0ofit="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 3of (itas string) as day_of_week as string as lowercase))) of (((current date - item 0ofit) / (item 3ofit * week) * (item 3ofit * week)) + item 0ofit & item 1ofit) of ((((date (local time zone) of item 1ofit - ((first 3of (item 1ofitas string) as day_of_week) - sunday))) , time (local time zone) of item 1of it, item 2of it, item 3ofit))) elseif (item 0ofit="monthly") then (it & (value of setting "MaintenanceWindow_WindowSizeMinutes"of client as integer * minute)) of ((if (item 3ofit=0) then (maximum of ((ifexists (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 1ofit) else nothing) ; (ifexists (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 1ofit) 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 1ofit) else nothing) ; (ifexists (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 1ofit) 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 1ofit) else nothing)) whose (it < now)) else (maximum of ((ifexists ((current month & (day_of_month (item 3ofit)))) then (((current month & (day_of_month (item 3ofit))) & current year) & time (local time zone) of item 1ofit) else nothing) ; (ifexists (((current month - 1* month) & (day_of_month (item 3ofit)))) then (if (current month as integer =1) then ((((current month - 1*month) & (day_of_month (item 3ofit))) & (current year - 1*year)) & time (local time zone) of item 1ofit) else (((current month - 1*month) & (day_of_month (item 3ofit))) & current year) & time (local time zone) of item 1ofit) else nothing) ; (ifexists (((current month - 2*month) & (day_of_month (item 3ofit)))) then (if (current month as integer =1) then ((((current month - 2*month) & (day_of_month (item 3ofit))) & (current year - 1*year)) & time (local time zone) of item 1ofit) else (((current month - 2*month) & (day_of_month (item 3ofit))) & current year) & time (local time zone) of item 1ofit) 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
NOT ( ( ( exists rule whose ( ( NOTexists local ports string ofitOR local ports string ofitcontains ( value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string ) OR local ports string ofit="*" ) AND ( ( ( application name ofit ends with"\BESClient.exe" ) ANDNOT ( service name ofit="BESClient" ) ) OR ( regex "^(\s)*$"= application name ofitAND regex "^(\s)*$"= service name ofit ) ) and enabled ofitand protocol ofit= udp and inbound ofitand profile ( current profile type of firewall ) ofit ) of firewall ) OR ( exists internet connection firewall whose ( enabled ofitANDexists port mapping whose ( enabled ofitAND protocol ofit="udp"AND internal port ofitas string = ( value "ListenPort"of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry ) as string ) ofit ) of adapters of network ) OR ( exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose ( ( exists value whose ( itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and ( itas string as lowercase contains"|protocol=17|"orNOT ( itas string as lowercase contains"|protocol" ) ) AND ( itas string as lowercase contains"|lport=" & ( value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string ) & "|"ORnot ( itas string as lowercase contains"|lport=" ) ) AND ( not ( ( itas string as lowercase contains"|app=" ) ) OR ( itas string as lowercase contains"|app="anditas string contains"\BESClient.exe|" ) ) AND ( ( itas string as lowercase contains"|profile=" & ( if ( current profile type of firewall = domain firewall profile type ) then"domain|"elseif ( current profile type of firewall = public firewall profile type ) then"public|"elseif ( current profile type of firewall = private firewall profile type ) then"private|"else"INVALID" ) ) ORnot ( itas string as lowercase contains"|profile" ) ) ) ofit ) ) of native registry ) OR ( ( ( exists key ( "HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & ( if ( current profile type of firewall = domain firewall profile type ) then"DomainProfile"else"StandardProfile" ) & "\GloballyOpenPorts" ) whose ( exists value whose ( ( name ofitas lowercase ="enabled" ) AND ( it=1 ) ) ofit ) ofit ) AND ( exists key ( "HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & ( if ( current profile type of firewall = domain firewall profile type ) then"DomainProfile"else"StandardProfile" ) & "\GloballyOpenPorts\List" ) whose ( exists value whose ( ( name ofitstartswith value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of x32 registry as string & ":" ) AND ( regex "^(\d)+:UDP:(.+)?:enabled:(.+)$"= name ofit ) ) ofit ) ofit ) ) of native registry ) OR ( ( ( exists key ( "HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & ( if ( current profile type of firewall = domain firewall profile type ) then"DomainProfile"else"StandardProfile" ) & "\AuthorizedApplications" ) whose ( exists value whose ( ( name ofitas lowercase ="enabled" ) AND ( it=1 ) ) ofit ) ofit ) AND ( exists key ( "HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & ( if ( current profile type of firewall = domain firewall profile type ) then"DomainProfile"else"StandardProfile" ) & "\AuthorizedApplications\List" ) whose ( exists value whose ( ( regex "^(.+)?\\BESClient.exe:(.+)?:enabled:(.+)$"= name ofit ) ) ofit ) ofit ) ) of native registry ) ) AND ( ( exists key ( "HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & ( if ( current profile type of firewall = domain firewall profile type ) then"DomainProfile"else"StandardProfile" ) & "\IcmpSettings" ) whose ( exists value whose ( name ofit="AllowInboundEchoRequest"andit=1 ) ofit ) of native registry ) OR ( ( ( exists rule whose ( ( enabled ofitand ( protocol ofit= internet protocol 1 ) and inbound ofitand profile ( current profile type of firewall ) ofitand ( regex "^(\s)*$"= application name ofitOR application name ofit ends with"\BESClient.exe" ) AND regex "^(\s)*$"= service name ofit ) ) of firewall ) OR ( exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose ( exists value whose ( itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and ( itas string as lowercase contains"|protocol=1|"orNOT ( itas string as lowercase contains"|protocol" ) ) AND ( itas string as lowercase contains"|lport=" & ( value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string ) & "|"ORnot ( itas string as lowercase contains"|lport=" ) ) AND ( not ( ( itas string as lowercase contains"|app=" ) ) OR ( if ( itas string as lowercase contains"|app=" ) then ( itas string contains"\BESClient.exe|" ) elsetrue ) AND ( ( itas string as lowercase contains"|profile=" & ( if ( current profile type of firewall = domain firewall profile type ) then"domain|"elseif ( current profile type of firewall = public firewall profile type ) then"public|"elseif ( current profile type of firewall = private firewall profile type ) then"private|"else"INVALID" ) ) ORnot ( itas string as lowercase contains"|profile" ) ) ) ofit ) ofit ) of native registry ) ) AND ( ( exists rule whose ( ( enabled ofitand ( protocol ofit= internet protocol 58 ) and inbound ofitand profile ( current profile type of firewall ) ofitand ( regex "^(\s)*$"= application name ofitOR application name ofit ends with"\BESClient.exe" ) AND regex "^(\s)*$"= service name ofit ) ) of firewall ) OR ( exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose ( exists value whose ( itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and ( itas string as lowercase contains"|protocol=58|"orNOT ( itas string as lowercase contains"|protocol" ) ) AND ( itas string as lowercase contains"|lport=" & ( value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string ) & "|"ORnot ( itas string as lowercase contains"|lport=" ) ) AND ( not ( ( itas string as lowercase contains"|app=" ) ) OR ( if ( itas string as lowercase contains"|app=" ) then ( itas string contains"\BESClient.exe|" ) elsetrue ) AND ( ( itas string as lowercase contains"|profile=" & ( if ( current profile type of firewall = domain firewall profile type ) then"domain|"elseif ( current profile type of firewall = public firewall profile type ) then"public|"elseif ( current profile type of firewall = private firewall profile type ) then"private|"else"INVALID" ) ) ORnot ( itas string as lowercase contains"|profile" ) ) ) ofit ) ofit ) of native registry ) ) ) ) )
NOT (((exists rule whose ((NOTexists local ports string ofitOR local ports string ofitcontains (value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string) OR local ports string ofit="*") AND (((application name ofit ends with"\BESClient.exe") ANDNOT (service name ofit="BESClient")) OR (regex "^(\s)*$"= application name ofitAND regex "^(\s)*$"= service name ofit)) and enabled ofitand protocol ofit= udp and inbound ofitand profile (current profile type of firewall) ofit) of firewall) OR (exists internet connection firewall whose (enabled ofitANDexists port mapping whose (enabled ofitAND protocol ofit="udp"AND internal port ofitas string = (value "ListenPort"of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry) as string) ofit) of adapters of network) OR (exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose ((exists value whose (itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and (itas string as lowercase contains"|protocol=17|"orNOT (itas string as lowercase contains"|protocol")) AND (itas string as lowercase contains"|lport=" & (value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string) & "|"ORnot (itas string as lowercase contains"|lport=")) AND (not ((itas string as lowercase contains"|app=")) OR (itas string as lowercase contains"|app="anditas string contains"\BESClient.exe|")) AND ((itas string as lowercase contains"|profile=" & (if (current profile type of firewall = domain firewall profile type) then"domain|"elseif (current profile type of firewall = public firewall profile type) then"public|"elseif (current profile type of firewall = private firewall profile type) then"private|"else"INVALID")) ORnot (itas string as lowercase contains"|profile"))) ofit)) of native registry) OR (((exists key ("HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & (if (current profile type of firewall = domain firewall profile type) then"DomainProfile"else"StandardProfile") & "\GloballyOpenPorts") whose (exists value whose ((name ofitas lowercase ="enabled") AND (it=1)) ofit) ofit) AND (exists key ("HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & (if (current profile type of firewall = domain firewall profile type) then"DomainProfile"else"StandardProfile") & "\GloballyOpenPorts\List") whose (exists value whose ((name ofitstartswith value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of x32 registry as string & ":") AND (regex "^(\d)+:UDP:(.+)?:enabled:(.+)$"= name ofit)) ofit) ofit)) of native registry) OR (((exists key ("HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & (if (current profile type of firewall = domain firewall profile type) then"DomainProfile"else"StandardProfile") & "\AuthorizedApplications") whose (exists value whose ((name ofitas lowercase ="enabled") AND (it=1)) ofit) ofit) AND (exists key ("HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & (if (current profile type of firewall = domain firewall profile type) then"DomainProfile"else"StandardProfile") & "\AuthorizedApplications\List") whose (exists value whose ((regex "^(.+)?\\BESClient.exe:(.+)?:enabled:(.+)$"= name ofit)) ofit) ofit)) of native registry)) AND ((exists key ("HKLM\SOFTWARE\Policies\Microsoft\WindowsFirewall\" & (if (current profile type of firewall = domain firewall profile type) then"DomainProfile"else"StandardProfile") & "\IcmpSettings") whose (exists value whose (name ofit="AllowInboundEchoRequest"andit=1) ofit) of native registry) OR (((exists rule whose ((enabled ofitand (protocol ofit= internet protocol 1) and inbound ofitand profile (current profile type of firewall) ofitand (regex "^(\s)*$"= application name ofitOR application name ofit ends with"\BESClient.exe") AND regex "^(\s)*$"= service name ofit)) of firewall) OR (exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose (exists value whose (itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and (itas string as lowercase contains"|protocol=1|"orNOT (itas string as lowercase contains"|protocol")) AND (itas string as lowercase contains"|lport=" & (value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string) & "|"ORnot (itas string as lowercase contains"|lport=")) AND (not ((itas string as lowercase contains"|app=")) OR (if (itas string as lowercase contains"|app=") then (itas string contains"\BESClient.exe|") elsetrue) AND ((itas string as lowercase contains"|profile=" & (if (current profile type of firewall = domain firewall profile type) then"domain|"elseif (current profile type of firewall = public firewall profile type) then"public|"elseif (current profile type of firewall = private firewall profile type) then"private|"else"INVALID")) ORnot (itas string as lowercase contains"|profile"))) ofit) ofit) of native registry)) AND ((exists rule whose ((enabled ofitand (protocol ofit= internet protocol 58) and inbound ofitand profile (current profile type of firewall) ofitand (regex "^(\s)*$"= application name ofitOR application name ofit ends with"\BESClient.exe") AND regex "^(\s)*$"= service name ofit)) of firewall) OR (exist key "HKLM\Software\Policies\Microsoft\WindowsFirewall\FirewallRules"whose (exists value whose (itas string as lowercase contains"|action=allow|"anditas string as lowercase contains"|active=true|"ANDitas string as lowercase contains"|dir=in|"and (itas string as lowercase contains"|protocol=58|"orNOT (itas string as lowercase contains"|protocol")) AND (itas string as lowercase contains"|lport=" & (value "ListenPort"of key "HKLM\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions"of registry as string) & "|"ORnot (itas string as lowercase contains"|lport=")) AND (not ((itas string as lowercase contains"|app=")) OR (if (itas string as lowercase contains"|app=") then (itas string contains"\BESClient.exe|") elsetrue) AND ((itas string as lowercase contains"|profile=" & (if (current profile type of firewall = domain firewall profile type) then"domain|"elseif (current profile type of firewall = public firewall profile type) then"public|"elseif (current profile type of firewall = private firewall profile type) then"private|"else"INVALID")) ORnot (itas string as lowercase contains"|profile"))) ofit) ofit) of native registry)))))