1 Reply Latest reply on Aug 31, 2011 12:45 PM by Rick.Smith1

    Query using wildcards in LD 8.7

    Rookie

      Hi

      Apologies if this question has been asked already.

       

      I am trying run a query searching for all machines with Office 2000 SR-1 because we still have machines with this version and also with Office 2000 SR-3 too.  The query works and produces the correct result however I would also like to use a wildcard for searching for specific departmental OU's but to exclude others.  The query I run is using the 'Not Like' value.  The OU's I have are as follows:

       

      OU=x,OU=SRG,DC=caaroot,DC=internal

      OU=x,OU=DAP,DC=caaroot,DC=internal

      OU=x,OU=CPG,DC=caaroot,DC=internal

      OU=x,OU=CC,DC=caaroot,DC=internal

       

      The x above indidicates the department which can one of many and I would like to exclude specfically any departments within the following value only:

       

      OU=%,OU=SRG,DC=caaroot,DC=internal

       

      I've tried various examples of using the % wildcard such as % % and %*% etc.  If I search for a specific department such as OU=Legal,OU=SRG,DC=caaroot,DC=internal then this works ok but because I have many departments I would like to use a wilcard instead for the first part of the string.

       

      The backend database is a SQL2000 server.  Please see file attached showing query used.

       

      Does anyone know if this is possible or is it a limitation with using wildcards in queries?  Unless the syntax I am using is wrong?

       

      Thanks for any help
      Matt

        • 1. Re: Query using wildcards in LD 8.7
          Rick.Smith1 Specialist

          Probably still not a question you have, but turned up in a search for the same question, so here is what i have found. If I'm wrong someone feel free to let me know.

           

          Normally with a SQL query you can use % as a wildcard, but in the LANDesk Queries 8 or 9, it does not seem to support it.

           

          Instead you would use

           

          (NOT LIKE OU=SRG,DC=caaroot,DC=internal AND

          NOT LIKE OU=DAP,DC=caaroot,DC=internal AND

          NOT LIKE OU=CPG,DC=caaroot,DC=internal AND

          NOT LIKE OU=CC,DC=caaroot,DC=internal)

           

          Or to find all windows 7 devices

           

          Computer.OS.NAME LIKE Windows 7

           

          Would return Windows 7 Ultimate, Professional, Basic, etc etc etc