« Previous Next »

Thread: LP_Toolkit.WMIQuery question

Last post 10-10-2006 1:59 PM by LogParser User : DEinspanjer. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 10-09-2006, 4:49 PM

    LP_Toolkit.WMIQuery question

    Good day all,

    I use a WMI script to retrieve Win32_Volume properties from a remote MS Cluster server, write the results to CSV and email to dept managers. I prefer the output options with Logparser and want to convert the script to the LP_Toolkit COM input but ran into a problem - how do I point this at a remote server?? 

    logparser "SELECT Name,Capacity,MUL(PROPSUM(FreeSpace), 100) AS Percent
    INTO VolSpace.gif
    FROM Win32_Volume
    WHERE Name LIKE '%PSSTATIC%'
    GROUP BY Name" -i:COM -iProgID:LP_ToolKit.WMIQuery -charttype:Column3D -View -ChartTitle:"Volume Space" -categories:off

    Seeing that there is a "iCOMParams" parameter available I opened the VBP file with VisStudio2005 looking for a COMPUTER property to call to but didn't see one. I'm no VB programmer by any means but did see this string:

    Public Property ComputerName() As String
    Get
    ComputerName = mvarComputerName
    End Get
    Set(ByVal Value As String)
    mvarComputerName = Value
    End Set
    End Property

    Then further down:

    m_sFromEntity = FromEntity
    sComputer = mvarComputerName
    oWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
    oClass = oWMIService.Get(m_sFromEntity)

    I need to manage the oWMIService string above. Any suggestions? Has anyone else used this class to query remote WMI properties? I thougt about giving this a stab myself and creating another VB function within the project, but when I opened it with VisStudio2005 there were many conversion errors so I think that path is screwed.

    TIA!

    -Greg

  • 10-09-2006, 5:03 PM In reply to

    RE: LP_Toolkit.WMIQuery question

    I'm not really familiar with the toolkit WMIQuery, but given the information you've provided, it seems like this would work:

    -i:COM -iProgID:LP_ToolKit.WMIQuery -iCOMParams:"ComputerName=myremoteserver" ...
  • 10-10-2006, 11:05 AM In reply to

    RE: LP_Toolkit.WMIQuery question

    Daniel,

    Thanks for the reply. I tried that this morning:

    logparser "SELECT Name, Capacity, MUL(PROPSUM(FreeSpace), 100) AS Percent
    INTO VolSpace.gif FROM Win32_Volume
    WHERE Name LIKE '%PSSTATIC%'
    GROUP BY Name,Capacity
    ORDER BY Percent DESC"
    -i:COM -iProgID:LP_ToolKit.WMIQuery -iCOMParams:ComputerName=PHPSVFS01 -charttype:Column3D
    -View -ChartTitle:"Volume Space" -categories:off

    And received this result:


    Task aborted.
    Column Name is not an INTEGER nor a REAL
    Statistics:
    -----------
    Elements processed: 0
    Elements output:    0
    Execution time:     13.70 seconds

    I tried running it again with a -h flag but received an error that field names can be retrieved only from input files SOOO I instead had it write to CSV just to make sure I was connecting to the server:

    logparser "SELECT Name, Capacity, FreeSpace
    INTO c:\temp\VolSpace.csv
    FROM Win32_Volume
    WHERE Name LIKE '%PSSTATIC%'"
    -i:COM -iProgID:LP_ToolKit.WMIQuery -iCOMParams:ComputerName=PHPSVFS01
     
    Statistics:
    -----------
    Elements processed: 58
    Elements output:    38
    Execution time:     14.59 seconds

    It worked beautifully and gave me the expected results so at least now I know that the parameter is working properly. Now I'll work on getting the original requested output COLUMN3D to work properly.

    Thx!

    -G

  • 10-10-2006, 1:59 PM In reply to

    RE: LP_Toolkit.WMIQuery question

    So that Column Name is not an integer error is coming from the Chart3D. It seems to want the first column to be a number.
    Did you try a different chart out?
Page 1 of 1 (4 items)
Microsoft Communities