if ( existstruewhose ( iftruethen ( exists main gather service ) elsefalse ) ) then ( if ( version of client >= "8.0" ) then ( version of main gather service as string ) else ( version of file ( ( if ( character 0ofit="%22" ) then ( substring between "%22"ofit ) elseit ) of image path of main gather service ) as string ) ) else"Not Installed"
if (existstruewhose(iftruethen(exists main gather service)elsefalse)) then (if (version of client >= "8.0") then (version of main gather service as string) else (version of file ((if (character 0ofit="%22") then (substring between "%22"ofit) elseit) of image path of main gather service) as string)) else"Not Installed"
if ( existstruewhose ( iftruethen ( exists key "HKLM\SOFTWARE\BigFix\BESAPI\Paths"of registry ) elsefalse ) ) then version of file ( value "base"of key "HKLM\SOFTWARE\BigFix\BESAPI\Paths"of registry as string & "BESAPI.dll" ) as string else"Not Installed"
if (existstruewhose(iftruethen(exists key "HKLM\SOFTWARE\BigFix\BESAPI\Paths"of registry)elsefalse)) then version of file (value "base"of key "HKLM\SOFTWARE\BigFix\BESAPI\Paths"of registry as string & "BESAPI.dll") as string else"Not Installed"
if ( existstruewhose ( iftruethen ( exists service "BESWebReportsServer" ) elsefalse ) ) then ( if ( version of client >= "8.0" ) then ( version of service "BESWebReportsServer"as string ) else ( version of file ( ( if ( character 0ofit="%22" ) then ( substring between "%22"ofit ) elseit ) of image path of service "BESWebReportsServer" ) as string ) ) else"Not Installed"
if (existstruewhose(iftruethen(exists service "BESWebReportsServer")elsefalse)) then (if (version of client >= "8.0") then (version of service "BESWebReportsServer"as string) else (version of file ((if (character 0ofit="%22") then (substring between "%22"ofit) elseit) of image path of service "BESWebReportsServer") as string)) else"Not Installed"
if ( ( itstartswith"127."ORitstartswith"::" ) of ( name of registration server as string ) ) then ( if ( ( exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit ) of client ) then ( preceding text of first "/"of ( following text of first "//"of ( value of setting "_BESRelay_PostResults_ParentRelayURL"of client as string ) ) ) else"n/a (BES Server Installed)" ) else"n/a (BES Relay Not Installed)"
if ((itstartswith"127."ORitstartswith"::") of (name of registration server as string)) then (if ((exists setting"_BESRelay_PostResults_ParentRelayURL"ofitANDexists value of setting"_BESRelay_PostResults_ParentRelayURL" ofit) of client) then (preceding text of first "/"of (following text of first "//"of (value of setting "_BESRelay_PostResults_ParentRelayURL"of client as string))) else"n/a (BES Server Installed)") else"n/a (BES Relay Not Installed)"
if ( ( itstartswith"127."ORitstartswith"::" ) of ( name of registration server as string ) ) then ( "n/a (Local Relay/Server)" ) else ( if ( ( exists setting "__RelaySelect_Automatic"of client ) and ( value of setting "__RelaySelect_Automatic"of client ="1" ) ) then"n/a (Automatic)"elseif ( ( notexists setting "__RelayServer1"of client ORnotexists value of setting "__RelayServer1"of client OR value of setting "__RelayServer1"of client ="" ) AND ( notexists setting "__RelayServer2"of client ORnotexists value of setting "__RelayServer2"of client OR value of setting "__RelayServer2"of client ="" ) ) then"Primary and Secondary Relay Not Set"elseif ( ( exists setting "__RelayServer1"of client ) AND ( exists setting "__RelayServer1"whose ( value ofitas string !="" ) of client ) AND ( ( preceding text of first "/"of following text of first "//"of ( value of setting "__RelayServer1"of client as string ) ) as lowercase ) = ( name of registration server as string as lowercase ) ) then"Using Primary Relay"elseif ( ( exists setting "__RelayServer2"of client ) AND ( exists setting "__RelayServer2"whose ( value ofitas string !="" ) of client ) AND ( ( preceding text of first "/"of following text of first "//"of ( value of setting "__RelayServer2"of client as string ) ) as lowercase ) = ( name of registration server as string as lowercase ) ) then"Using Secondary Relay"elseif ( ( name of registration server as string as lowercase ) = ( preceding text of first "/"of following text of first "//"of ( value of setting "__Relay_Control_RootServer"of client as string as lowercase ) ) ) then"Defaulting to Main BES Server"else"Unknown State" )
if ((itstartswith"127."ORitstartswith"::") of (name of registration server as string)) then ("n/a (Local Relay/Server)") else(if ((exists setting "__RelaySelect_Automatic"of client) and (value of setting "__RelaySelect_Automatic"of client ="1")) then"n/a (Automatic)"elseif ((notexists setting "__RelayServer1"of client ORnotexists value of setting "__RelayServer1"of client OR value of setting "__RelayServer1"of client ="") AND (notexists setting "__RelayServer2"of client ORnotexists value of setting "__RelayServer2"of client OR value of setting "__RelayServer2"of client ="")) then"Primary and Secondary Relay Not Set"elseif ((exists setting "__RelayServer1"of client) AND (exists setting "__RelayServer1"whose (value ofitas string !="") of client ) AND ((preceding text of first "/"of following text of first "//"of (value of setting "__RelayServer1"of client as string)) as lowercase) = (name of registration server as string as lowercase)) then"Using Primary Relay"elseif ((exists setting "__RelayServer2"of client) AND (exists setting "__RelayServer2"whose (value ofitas string !="") of client ) AND ((preceding text of first "/"of following text of first "//"of (value of setting "__RelayServer2"of client as string)) as lowercase) = (name of registration server as string as lowercase)) then"Using Secondary Relay"elseif ((name of registration server as string as lowercase) = (preceding text of first "/"of following text of first "//"of (value of setting "__Relay_Control_RootServer"of client as string as lowercase))) then"Defaulting to Main BES Server"else"Unknown State")
if ( exists setting "_BESClient_Download_LimitBytesPerSecond"whose ( exists value ofit ) of client ) then value of setting "_BESClient_Download_LimitBytesPerSecond"of client else"not set"
if (exists setting "_BESClient_Download_LimitBytesPerSecond"whose (exists value ofit) of client) then value of setting "_BESClient_Download_LimitBytesPerSecond"of client else"not set"
if ( exists service "BESRelay" ) then ( if ( exists setting "_BESGather_Download_LimitBytesPerSecond"whose ( exists value ofit ) of client ) then value of setting "_BESGather_Download_LimitBytesPerSecond"of client else"not set" ) else"BES Relay Not Installed"
if (exists service "BESRelay") then (if (exists setting "_BESGather_Download_LimitBytesPerSecond"whose (exists value ofit) of client) then value of setting "_BESGather_Download_LimitBytesPerSecond"of client else"not set") else"BES Relay Not Installed"