none
WINRM - Get-WmiObject -Query not giving expected results RRS feed

  • Question

  • I am executing the below command in Powershell, but not getting the complete result.

        Get-WmiObject -Query "Select * From Meta_Class Where __SuperClass='Win32_PerfRawData'"

    The Result is coming as shown below,

    Name                                Methods              Properties
    ----                                -------              ----------
    Win32_PerfRawData_vmGuestLib_VCPU   {}                   {Caption, CpuLimitMHz, CpuReservationMHz, CpuShares...}
    Win32_PerfRawData_vmGuestLib_VMEM   {}                   {Caption, Description, Frequency_Object, Frequency_PerfTime...}
    Win32_PerfRawData_AFDCounters_Mi... {}                   {Caption, Description, DroppedDatagrams, DroppedDatagramsPersec...}
    Win32_PerfRawData_AuthorizationM... {}                   {Caption, Description, Frequency_Object, Frequency_PerfTime...}
    Win32_PerfRawData_Counters_AppVC... {}                   {Caption, Description, Frequency_Object, Frequency_PerfTime...}
    Win32_PerfRawData_Counters_DNS64... {}                   {AAAAqueriesFailed, AAAAqueriesSuccessful, AAAASynthesizedrecords, Caption...}
    Win32_PerfRawData_Counters_Event... {}                   {Caption, Description, Frequency_Object, Frequency_PerfTime...}
    Win32_PerfRawData_Counters_Event... {}                   {BufferMemoryUsageNonPagedPool, BufferMemoryUsagePagedPool, Caption, Description...}
    Win32_PerfRawData_Counters_FileS... {}                   {Caption, Description, FileSystemBytesRead, FileSystemBytesWritten...}
    Win32_PerfRawData_Counters_Gener... {}                   {AuthIPMainModeNegotiationTime, AuthIPQuickModeNegotiationTime, Caption, Description...}
    Win32_PerfRawData_Counters_HTTPS... {}                   {Caption, CurrentUrisCached, Description, Frequency_Object...}
    Win32_PerfRawData_Counters_HTTPS... {}                   {ArrivalRate, CacheHitRate, Caption, CurrentQueueSize...}
    Win32_PerfRawData_Counters_HTTPS... {}                   {AllRequests, BytesReceivedRate, BytesSentRate, BytesTransferredRate...}
    Win32_PerfRawData_Counters_Hyper... {}                   {Caption, Description, Frequency_Object, Frequency_PerfTime...}
    Win32_PerfRawData_Counters_Hyper... {}                   {BytesReadPersec, BytesWrittenPersec, Caption, Description...}
    Win32_PerfRawData_Counters_IPHTT... {}                   {Caption, Description, DropsNeighborresolutiontimeouts, ErrorsAuthenticationErrors...}
    Win32_PerfRawData_Counters_IPHTT... {}                   {Bytesreceivedonthissession, Bytessentonthissession, Caption, Description...}
    Win32_PerfRawData_Counters_IPsec... {}                   {ActiveExtendedModeSAs, ActiveMainModeSAs, ActiveQuickModeSAs, Caption...}
    Win32_PerfRawData_Counters_IPsec... {}                   {ActiveExtendedModeSAs, ActiveMainModeSAs, ActiveQuickModeSAs, Caption...}
    How can i get the complete result instead of ...?

    Wednesday, August 21, 2019 10:31 AM

All replies

  • Hi,

    To achieve this, we've multiple methods

    Get-WmiObject -Query "Select * From Meta_Class Where __SuperClass='Win32_PerfRawData'" | export-csv c:\temp\111.csv
    (make sure c:\temp exists)

    Get-WmiObject -Query "Select * From Meta_Class Where __SuperClass='Win32_PerfRawData'" | select name | ft -autosize


    Hope the above information helps.

    Regards,

    Alex Zhu
    -----------------------------------------------
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Thursday, August 22, 2019 12:50 AM
  • Thanks Alex,

    With the above command I can see the Name filed is coming properly, but how do we get the entire list of properties for that Class. 

    Regards
    Bhabani

    Thursday, August 22, 2019 6:14 AM
  • Hi,

    Please try the following cmdlet to see if it works

    Get-WmiObject -Query "Select * From Meta_Class Where __SuperClass='Win32_PerfRawData'"| Select-Object -ExpandProperty Properties -Property @{N='OName'; E={$_.Name}} | export-csv c:\temp\1212.csv -NoTypeInformation

    Hope the above information helps.

    Regards,

    Alex Zhu
    -----------------------------------------------
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Monday, August 26, 2019 9:02 AM