/build/static/layout/Breadcrumb_cap_w.png

Custom invetory rule question

I am trying to create a rule that reads a txt file on workstations and if it finds the matching words so I can create a report of workstations that match. The cusomt inventory rule that I have in place is


ShellCommandTextReturn(cmd /c type c:\Folder\file.txt | find "text")


I am not returning any results, can someone point me in the right direction


Thanks


0 Comments   [ + ] Show comments

Answers (3)

Posted by: SMal.tmcc 9 years ago
Red Belt
1
I use this one to search the hosts files on machines for anyline that does not begin with a #

ShellCommandTextReturn(cmd /c echo off & for %g in (C:\Windows\System32\drivers\etc\hosts) do (findstr /b /v /c:"#" %g))

this one reads the bios text file I created with the CCTK to list the bootorder on machines

ShellCommandTextReturn(cmd /c @echo off && for %g in (c:\programdata\dell\kace\user\bios.txt) do (findstr /b /c:"bootorder" %g))
Posted by: joshuaer 9 years ago
Senior Yellow Belt
1

thank you for the help, I have been playing with this all day and not been able to get it to work properly.

ShellCommandTextReturn(cmd /c type C:\celerant\RMS6\celMainlog.txt findstr /I "port=8601")


 I have also tried the examples given but not been able to get it to pull the information. if I run this command via command line it finds the information I am looking for. Thanks for the help


Comments:
  • can you email that file with the entry and I will give you the exact verbiage to use - SMal.tmcc 9 years ago
    • thank you for your help, I have emailed you the file - joshuaer 9 years ago
  • (cmd /c @echo off && for %g in (celMainLog.txt) do (findstr /c:"PORT=8580" %g)) - SMal.tmcc 9 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ