Is it possible to do this natively in the new version? If not how can it be accomplished?

Thanks
1 Comment   [ + ] Show Comment

Comments

  • Thank you for the detailed information, I took a slightly different approach to this.

    Create a Online KScript which runs net use and dumps the mapped.txt to %temp%.

    Then I have a CustomInventory to read that file but It's not showing up even after forcing an Inventory. Am i missing something?
    • %temp% variable is a user variable so same problem, the cir runs as system and looks at its temp area
Please log in to comment

Community Chosen Answer

1
The printers are under the machines inventory.  The mapped drives are user items so you need to run the query as the user not system.  So a custom software inventory will not directly work.  I use a 2 step approach.  I run a script to create files from the users stand point for a custom inventory's to read.  This runs invisible every couple of hours during the work days.

I use this method to hide the batch file:
http://www.itninja.com/blog/view/how-to-hide-running-a-batch-file-from-a-kscript-with-version-5-5

here is the batch file I run in the script



I then use custom inventories to read the files





Answered 08/27/2014 by: SMal.tmcc
Red Belt

  • I guess i'm not familiar with the custom inventories feature. where would i go to get to that? getting this setup would be very useful for me.
  • Currently using KACE server 6.4.120261
  • I think you can disregard, i went to Inventory>software>create new. Looks like where you went.
    • yea
      • when i test run the Kscript, i get this error:

        Script:
        c:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\111\invisible.vbs

        Line: 1
        Char: 1
        Error: The Sytem Could not find the file specified.
        Code: 80070002
        Source: (Null)

        I've checked the directory these scripts are supposed to go to and they are where they are supposed to be (according to the dir location in this error)

        I've checked the scripts several times and they look good.

        I've checked my custom inventory rules several times and they look the way they're supposed to.

        It seems to brought my HKCU run keys into my custom inventory string, but has failed to do so for the mapped drives.
      • see new answer for this info
Please log in to comment

Answers

0

This was written for 6.2, if you are 6.3 or 6.4 it will hide the batch file for you now.  you can attach the batch and call it or create a online shell script and paste your lines in there.  Make sure if you create a shell script you rename the extension to .bat
like in this example from another question


Answered 02/17/2016 by: SMal.tmcc
Red Belt

  • My mapped drives are still not pulling into the custom inventory field. and the text file it generates for the mapped drives into simply turns up blank - no inventory info in it.

    Here is the .bat file:
    reg.exe query hkcu\software\microsoft\windows\currentversion\run /s > C:\ProgramData\Dell\KACE\user\hkcuRunKeys.txt

    reg.exe query hkcu\software\microsoft\windows\currentversion\uninstall /s /f DisplayName > C:\ProgramData\Dell\KACE\user\hkcuSoftware.txt

    wmic logicaldisk where "drivetype='4" get deviceid,providername > C:\ProgramData\Dell\KACE\user\NetworkDrives.txt

    exit

    I also tried this bat as an online shell script like you suggested, but still no dice on the mapped drives.
Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share