/build/static/layout/Breadcrumb_cap_w.png

Creating a report for machines that do not have a Folder by a specific name

We developed a script to copy the preference file to users C:\Users\username\Appdata\Local\Mozilla\Firefox\Profiles and the name of the folder with the preference file is named (our Company). That folder gets copied to the above location and i need to develop a report of the machines that get that folder and machines that dont have that folder. The preference file disables Mozilla Firefox password storage in the cloud and disables automatic updates. I need o develop a report of machines that have and do not have that folder so we can determine who's machines do not have the preference file that disable features in firefox that are a security risk.

2 Comments   [ + ] Show comments
  • Still no luck using:
    C:\ProgramData\Dell\KACE\user for the target directory.

    so
    echo "your message here" > c:\ProgramData\Dell\KACE\user\ffdircheck.txt - CEads 9 years ago
  • Thanks. I tried that as well but still no luck. The file just doesn't want to get created either way i decide to go. Im thinking about trying to enter a registry value during the install and run a report that way. - CEads 9 years ago

Answers (3)

Posted by: rockhead44 9 years ago
Red Belt
0
If you haven't done so, create a custom inventory rule within Software to identify the folder using this syntax

DirectoryExists(C:\Users\username\Appdata\Local\Mozilla\Firefox\Profiles\our Company)

Once the machines check in, that will show in the Installed Software record if it exists. From there, create a smart label to identify based on your criteria. I would create 2, one with Software Titles begins with and one with Software Titles does not begin with, followed by whatever name you give the custom inventory rule.

From there, target the does not contain label within your custom inventory rule to deploy to those machines.

Comments:
  • that will not work for mulitple users on multiple machines. - SMal.tmcc 9 years ago
    • Good point. Can a wild card be used in the path? - rockhead44 9 years ago
Posted by: SMal.tmcc 9 years ago
Red Belt
0
You are between a rock and hard place with this one.  Custom Software inventories run as system so user env variables will not work like %localappdata%.  You will need to use something like a WMIC call such as:
shellcommandtextretturn(cmd /c wmic fsdir where name like '%%firefox\\profiles\OurCompany' list instance)
Mozilla\Firefox\Profiles\our Company

Comments:
  • What if the script was run as user logged into console? Our company doesn't allow multiple users to log into one machine. Each machine is dedicated to a specific user. We execute the script as the user logged into console so it goes to that users profile. Would that work? The full path to the folder I am looking to generate the report is: C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\CompanyName - CEads 9 years ago
    • I collect info on users for malware prevention. I do that by running a batch file task via a kscript as logged in user. That kscript then creates files in c:\programdata\dell\kace. I then have custom software rules that read those files and that gives me the info I need. It is a 2 step process but it works.

      Create a Kscript and run it as current logged in user, see other answer for screen shots - SMal.tmcc 9 years ago
Posted by: SMal.tmcc 9 years ago
Red Belt
0


then you can create a custom software inventory to read this file.  If the file does not exist you know the script has not been run against this machine.

ShellCommandTextReturn(cmd /c type C:\ProgramData\Dell\KACE\ffdircheck.txt)


Comments:
  • oops sorry about the cut and paste of your path. use for verify a direcotory exists:

    %appdata%\mozilla\firefox\profiles\companyname - SMal.tmcc 9 years ago
  • Thanks I got the script setup as in your screenshot but the file isn't being copied to the location. I attached two documents that show how the script was setup and the logs. Does it look like I missed typed something?? - CEads 9 years ago
    • missing \ after the c: in your script
      should be c:\programdata - SMal.tmcc 9 years ago
      • No Joy. Same results, the txt file isn't being copied to the machines and logs re the same. - CEads 9 years ago
      • Ahh, this helped me figure out one of my problems also. With version 6.0 kace they changed the security on the dell\kace structure. All users used to have rights to c:\programdata\dell\kace. they have made it read only. but they created a new folder that we can use under this. I am making changes to my scipts now.

        Use:
        C:\ProgramData\Dell\KACE\user for the target directory.

        so
        echo "your message here" > c:\ProgramData\Dell\KACE\user\ffdircheck.txt - SMal.tmcc 9 years ago
      • I saw also one other thing. On success you want to right "directory exists". Currently your script will check for that directory and then write to the text file it does not exist when it does and do nothing when it does not.

        if you do not want a positive return only do a verfify then a remediation. Look at the picture I posted and you will see the difference in the verbage. I would have it post both the positive and negative returns to a file, because if the file does not exist you know you have not run the script against that machine yet. - 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

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