Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process processID null windows server 2016

CARRIE Charlotte 1 Reputation point
2021-03-22T11:54:25.557+00:00

Bonjour, je rencontre actuellement un problème , lors que j'essaye d'obtenir le CPU d'un process winword en passant par le code :
$numeroID = (get-process "winword").id (correctement renseigné)
Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process -filter "IDProcess ='$numeroID'"

cette ligne me retourne une erreur :

Get-WmiObject : Classe non valide « Win32_PerfFormattedData_PerfProc_Process » Au caractère Ligne:1 : 1 + Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process -filter ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

a d'autre moment avec toujours la meme ligne de commande , il me retourne des informations mais je me retrouve avec un ProcessID à zéro donc impossible de faire le lien avec $numeroID qui lui est bien renseigné.

retour dans powershell : _
_GENUS : 2
__CLASS : Win32_PerfFormattedData_PerfProc_Process
__SUPERCLASS : Win32_PerfFormattedData __DYNASTY : CIM_StatisticalInformation __RELPATH : Win32_PerfFormattedData_PerfProc_Process.Name="WINWORD" __PROPERTY_COUNT : 35 __DERIVATION : {Win32_PerfFormattedData, Win32_Perf, CIM_StatisticalInformation} __SERVER : MAMACHINE __NAMESPACE : root\cimv2 __PATH : \MAMACHINE\root\cimv2:Win32_PerfFormattedData_PerfProc_Process.Name="WINWORD" Caption : CreatingProcessID : 3936 Description : ElapsedTime : XXXX Frequency_Object : Frequency_PerfTime : Frequency_Sys100NS : HandleCount : XXX IODataBytesPersec : 0 IODataOperationsPersec : 0 IOOtherBytesPersec : 0 IOOtherOperationsPersec : 0 IOReadBytesPersec : 0 IOReadOperationsPersec : 0 IOWriteBytesPersec : 0 IOWriteOperationsPersec : 0
Name : WINWORD
PageFaultsPersec : 0 PageFileBytes : XXXXXX PercentPrivilegedTime : 0
PercentProcessorTime : 0
PercentUserTime : 0 PoolNonpagedBytes : XXXXX PoolPagedBytes : XXXXX PriorityBase : 8 PrivateBytes : XXXXXXX
ProcessID : 0
ThreadCount : 9 Timestamp_Object : Timestamp_PerfTime : Timestamp_Sys100NS : VirtualBytes : XXXXXX WorkingSet : XXXXXXX WorkingSetPeak : XXXXXXX WorkingSetPrivate : XXXXXX
PSComputerName : MAMACHINE

les XXXXXX sont des valeurs numériques , le processID est à zero donc impossible de retrouver son CPU , que ce soit avec un filtre "IDProcess ='$numeroID'" ou "Name = 'WINWORD'"

je ne sais plus quoi faire
j'ai deja plusieurs fois essayer de reparer le WMI , rien n'y fait , l'erreur de classe introuvable apparait de facon random sans vraiment savoir pourquoi , parfois elle existe parfois non , et quand elle est bien retrouvé , le processID est à 0 a la place de la valeur obtenu a l'aide de cette ligne :
(get-process "winword").id

merci de votre retour Mon PC est un windows server 2016 64 bits

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,682 questions
{count} votes

10 answers

Sort by: Most helpful
  1. JiayaoZhu 3,911 Reputation points
    2021-03-23T09:30:46.463+00:00

    Hi,

    Thank you for your visit!

    Based on your descriptions, I suggest that your issue may be attributed to WMI and I hope you could first check your event logs to see whether you have any error codes and messages related to your issue.

    You can check your event logs through: Event Viewer>> Applications and Services>> Microsoft>> Windows>> WMI-Activity and WMI Services

    You can screenshot any error codes and messages and send them to us, to see if we could help you solve you issue. Thank you for your understanding!

    Best wishes
    Joan

    --------------------------------------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. CARRIE Charlotte 1 Reputation point
    2021-03-30T12:51:56.467+00:00

    Hello ,

    i had check where you tell me , i only find WMI_Activity , even WMI Services dont exists.

    this is the error in the folder WMI Activity i find.

    0 comments No comments

  3. CARRIE Charlotte 1 Reputation point
    2021-03-30T12:52:25.493+00:00

    82668-2021-03-30-14h47-24.png

    0 comments No comments

  4. JiayaoZhu 3,911 Reputation points
    2021-04-01T07:27:46.06+00:00

    Hi,

    Thank you for your reply!

    According to your error code: 0x80041010 [Invalid WMI class], it seems that your issue is related to your WMI. And I suppose you could first use the below article to do a general troubleshooting to see whether you issue can be solved:

    https://www.virtuallyboring.com/microsoft-wmi-invalid-class-error-0x80041010/

    (Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)

    If you have already done this troubleshooting before and it didn't work, please let me know the details, such as the error code or message that you encountered when you tried to solve the issue.

    Best regards
    Joann

    --------------------------------------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  5. CARRIE Charlotte 1 Reputation point
    2021-04-07T07:36:18.35+00:00

    hello im back i had do the step 1 , the app windows tell me the classe WMI is okay and for the process 2 , the app isnt downloable.

    i stay block on my problem.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.