You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-03-30 13:51:23

achilleb
Member
Registered: 2023-03-30
Posts: 3

Glpi inventory WMI collect information about directory

I'm trying to collect info from host by WMI, i try a simply request and this work fine for example:

moniker = winmgmts:/root/CIMV2
class = Win32_LogicalDisk
properties = Name

to get a specific properties from folder and i set this:

moniker = winmgmts:/root/CIMV2:Win32_Directory='C:\\System Volume Information'
class = Win32_Directory
properties = CreationDate

I get error:

Win32::OLE ERROR: Win32::OLE(0.1713) error 0x80020003: "Impossibile trovare membro" in METHOD/PROPERTYGET ""

Same code used in VBS works fine.

I don't know what i'm doing wrong.

(I need to know when the disk/parition was formatted and i found you can retive the information by get the creation date of C:\\System Volume Information folder)

Offline

#2 2023-03-30 14:39:10

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: Glpi inventory WMI collect information about directory

Hi achilleb

I see 2 problems with your try related to the Collect task:

1. You want to select one object, the one with the path 'C:\\System Volume Information'. The collect task was not develop to support filtering, so it will run on all objects of the class you're requesting.
2. The CreationDate property type is DateTime, and this is actually not supported. I didn't tested but you'll probably obtain a not readable string.

With such a problem, you probably want to run a dedicated script which will update a value in registry and use collect task to request that registry value.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2023-03-30 16:05:33

achilleb
Member
Registered: 2023-03-30
Posts: 3

Re: Glpi inventory WMI collect information about directory

I suspected the collector not support filtering and without that the WMI return all directory (it go timeout) and the return value is like 20200628164132.654955+120 so finally i decided to deploy a script to store value in registy and collect it after as your solution.

Thanks for the help!

Last edited by achilleb (2023-03-30 16:05:42)

Offline

Board footer

Powered by FluxBB