/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


KACE Custom Inventory Rule to search all local drives.

03/29/2019 461 views

Hi,


I need a rule that can search all local drives for Drupal.  I'm using the following rule to search the C: drive, but just realized there are other servers in the company that have Drupal on the D or E drives.  Is there a way to run the rule on all local drives?

Below is what I'm currently using.


ShellCommandTextReturn(dir c:\drupal /s > %1 & type %1)


Thanks


Tony

0 Comments   [ + ] Show comments

Comments


All Answers

0
It might be easier to do this in Powershell


(gwmi -query 'select deviceID from win32_logicaldisk where drivetype=3').deviceID | % {gci $_\drupal -recurse -erroraction silentlycontinue}
Answered 03/31/2019 by: flip1001
Black Belt

Don't be a Stranger!

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

Sign up! or login

View more:

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