2 Replies Latest reply on Jul 15, 2016 2:42 AM by phoffmann

    Query - Search in a file

    Apprentice

      Hi,

       

      I would like to search a value in the file ? It's possible with query ?

       

      Example, I would like the to find the PCs integrate after a date.

       

      Info.bat in C:\Windows

      ---------------------------------

      @echo off

      Title Informations

      echo Nom de l'ordinateur : %COMPUTERNAME%

      echo ---

      ipconfig |findstr "IPv4"

      echo ---

      echo Version de l'image : 3c (64bits) du 05/02/2016

      echo Integration du poste : 22/04/2016

      pause

      exit

        • 1. Re: Query - Search in a file
          ahe Expert

          Hello,

           

          I'm not sure, if I understand right...

           

          What do you mean with: "I would like the to find the PCs integrate after a date."

           

          In your batch you wrote nothing in a file, you show something only (the echo's and the ipconfig command).

           

          If you want to know, the Image version you've created and the date of the image (installation date or image creation date?), I would write these information in registry and scan for it via LANDesk Inventory scanner with entries in "Manage Software List - Custom Data - Registry Items"

           

          Client installation date is stored in inventory below "OS - NT Info - install Date"

          IPv4 Adress you can find below "Network - TCPIP - Bound Adapter - ..."

           

          BR

          Axel

          • 2. Re: Query - Search in a file
            phoffmann SupportEmployee

            *IF* I understand you correctly ...

             

            ... you want to search a file (by script usually), and then have that data value brought back to the Core - correct?

             

            In that regards - yes - that's perfectly doable. And there's a bunch of different ways that you can get this data added to inventory - it's a "choose your own adventure" affair.

             

            In essence, you need to mainly worry on your script that picks up the relevant data - and then deposit it in a place that we'll be able to pick it up from. This is usually a specific file (if you want to use the LDISCNHLP.INI based approach) and/or a registry value (in which case you can configure that registry key to be read & added to inventory globally on the Core):

             

            Not useful for "permanent" inventory, but mentioned for completeness - how to send individual bits of custom data via miniscan (the switch & functionality has been taken over by LDISCN32 as of LD 9.6).

             

            LDISCNHLP.INI-based example of adding custom data to inventory:

             

            Registry-based example of adding custom data to inventory (scroll to the bottom - since you don't have to manually deal with files as of 9.5 onward):

             

            ... that should help you along as an introduction?