0 Replies Latest reply on Aug 22, 2008 9:02 AM by epo909

    HowTo - Playing around with QueryList.xml

    epo909
      For those that still haven't taken the 'great leap forward' for ePO 4.0, and still (and will 'till EOL) remain at the cozy shadow of ePO 3.6.1 (yes I'm an old school), here's a tip on how to improve the ePO console search box.

      In the file QueryList.xml (\Program Files\Network Associates\ePO\3.6.1\DB\Info\Query\) theres a reference for all the .xml files that allows the ePO console user to search for specific fields, for example the search for Specific Computer names or search for computers in a group.

      Since the beginning there where two types of search I really missed... the search for 'username' or search for 'IP Address'. So I decided to peek into the QueryList.xml and start crafting.

      Ok, each query requires its own .xml file, so I created a SearchUser.xml and a SearchIP.xml files.

      SearchUser.xml:

      <?xml version="1.0" encoding="UTF-16"?>

      <Query name="QueryName" Description="QueryDesc">

      <DisplayFields>
      <Field name="AutoID" Display="0" >LeafNode.AutoID</Field>
      <Field name="NodeName" Display="1" >LeafNode.NodeName</Field>
      <Field name="Username" Display="1" >ComputerProperties.Username</Field>
      <Field name="Loc" Display="1" >ReportFullPathNodeID.FullPathShortName</Field>
      </DisplayFields>

      <Tables>
      <Table>LeafNode</Table>
      <Table>ComputerProperties</Table>
      <Table>ReportFullPathNodeID</Table>
      </Tables>

      <Where> (Condition1) and
      (LeafNode.AutoId = ComputerProperties.ParentID) and
      (LeafNode.ParentID *= ReportFullPathNodeID.LowestNodeID)
      </Where>

      <Conditions>
      <Condition name="Condition1">
      <lValue name="Username" DatabaseField="ComputerProperties.Username">name</lValue>
      <Operator UIType="PreDefinedLike">Like</Operator>
      <rValue UIType="AskUserString" ></rValue>
      </Condition>

      </Conditions>

      <TranslationTable>
      <LocaleTable LocaleID="0409">
      <Key Field="QueryName">Specific usernames</Key>
      <Key Field="Username">Username</Key>
      <Key Field="Loc">Location</Key>
      <Key Field="DomainName">Domain Name</Key>
      <Key Field="QueryDesc">Search for computer with a given username</Key>
      <Key Field="Like">Like</Key>
      </LocaleTable>
      </TranslationTable>

      </Query>


      SearchIP.xml:

      <?xml version="1.0" encoding="UTF-16"?>

      <Query name="QueryName" Description="QueryDesc">

      <DisplayFields>
      <Field name="AutoID" Display="0" >LeafNode.AutoID</Field>
      <Field name="NodeName" Display="1" >LeafNode.NodeName</Field>
      <Field name="IPAddress" Display="1" >ComputerProperties.IPAddress</Field>
      <Field name="Loc" Display="1" >ReportFullPathNodeID.FullPathShortName</Field>
      </DisplayFields>

      <Tables>
      <Table>LeafNode</Table>
      <Table>ComputerProperties</Table>
      <Table>ReportFullPathNodeID</Table>
      </Tables>

      <Where> (Condition1) and
      (LeafNode.AutoId = ComputerProperties.ParentID) and
      (LeafNode.ParentID *= ReportFullPathNodeID.LowestNodeID)
      </Where>

      <Conditions>
      <Condition name="Condition1">
      <lValue name="IPAddress" DatabaseField="ComputerProperties.IPAddress">IP Address</lValue>
      <Operator UIType="PreDefinedLike">Like</Operator>
      <rValue UIType="AskUserString" ></rValue>
      </Condition>

      </Conditions>

      <TranslationTable>
      <LocaleTable LocaleID="0409">
      <Key Field="QueryName">Specific IP Address</Key>
      <Key Field="IPAddress">IP</Key>
      <Key Field="Loc">Location</Key>
      <Key Field="DomainName">Domain Name</Key>
      <Key Field="QueryDesc">Search for computer with a given IP Address</Key>
      <Key Field="Like">Like</Key>
      </LocaleTable>
      </TranslationTable>

      </Query>


      Then I added this two lines to the QueryList.xml:


      <?xml version="1.0" encoding="UTF-16" ?>
      <QueryList>

      ...<snipped>...

      <QueryFile>SearchUser.xml</QueryFile>
      <QueryFile>SearchIP.xml</QueryFile>

      ...<snipped>...

      </QueryList>


      Close the ePO console and reopen. Open search and voilá!

      Regards.