/build/static/layout/Breadcrumb_cap_w.png

Returning FileInfoReturn into a customer inventory field that might exist in multiple paths

I'm trying to return attributes of a executable file that will exist in different paths based on if the executable is on a 32 or 64 bit version of windows.

I've tried the following custom rules:


FileExists (C:\Program Files\CUSTOMAPP\Service\executable.exe) AND

FileInfoReturn(C:\Program Files\CUSTOMAPP\Service\executable.exe, size, NUMBER) OR 

FileExists (C:\Program Files (x86)\CUSTOM APP\Service\executable.exe) AND

FileInfoReturn(C:\Program Files (x86)\CUSTOM APP\Service\executable.exe, size, NUMBER)



FileInfoReturn(C:\Program Files\CUSTOMAPP\Service\executable.exe, size, NUMBER) OR 

FileInfoReturn(C:\Program Files (x86)\CUSTOM APP\Service\executable.exe, size, NUMBER)


No matter in the kdeploy always returns FALSE when the rule is executed.

[2019-04-02.15:59:16][KDeploy:CDeployController::Execu] rule [21157] statement result: "", FALSE


I can get the value to populate only when it's just the single FileInfoReturn function is used.


The Kace agent is version 9.0.270


1 Comment   [ + ] Show comment
  • Either create 2 custom inventory rules or adapt the answer by gerane from this post https://www.itninja.com/question/powershell-script-in-custom-inventory-rule - flip1001 5 years ago

Answers (1)

Posted by: chucksteel 5 years ago
Red Belt
0

I have done this with ShellCommandTextReturn for reading a file's contents:

ShellCommandTextReturn(cmd /c type "c:\Program Files (x86)\Stata13\stata.lic") or
ShellCommandTextReturn(cmd /c type "c:\Program Files\Stata13\stata.lic")

And with MD5 (which might be a better way to differentiate in your case, too):

FileExistsWithMD5(C:\Program Files (x86)\IBM\SPSS\Statistics\25\stats.exe, 0f81795b72883f5edb8c0e1c436ad4cd) OR FileExistsWithMD5(C:\Program Files\IBM\SPSS\Statistics\25\stats.exe, 0f81795b72883f5edb8c0e1c436ad4cd) 


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