Hey folks I've got a couple custom inventories that I've noticed have stopped working since we upgraded to 5.5

ShellCommandTextReturn(wmic netlogin get Name, NumberOfLogons)

ShellCommandTextReturn(wmic MemoryChip get banklabel) AND ShellCommandTextReturn(wmic memorychip get capacity)

The above ones all worked perfectly on 5.4.

And now the one from today which is how I noticed these weren't working any longer:

ShellCommandTextReturn(wmic DiskDrive Get Status)

I can see in the logs where the CI's are running, they just aren't running properly.

Any thoughts?


Answer Summary:
2 Comments   [ + ] Show Comments


  • Try putting cmd /c before wmic
  • Worked like a champ. Thanks very much.
Please log in to comment



ShellCommandTextReturn(cmd.exe /c wmic netlogin get Name, NumberOfLogons)

This may have been resolved with the latest path to 5.5.90546 (not tested).

Answered 12/18/2013 by: dugullett
Red Belt

  • Where did you learn about this /c? I haven't tried it yet, but just wondering where in the documentation I missed it.
    • Reading the logs. I think there was also a post somewhere about it. I'm also having to use it now on some of my scripts.
      • How quickly I forget.... It looks like I've asked a similar question a while back. http://www.itninja.com/question/5-5-agent-custom-inventory-rule
  • That worked like a champ. Thanks very much.
Please log in to comment
Answer this question or Comment on this question for clarity