Find the worker process for a Hyper-V VM in 2012 R2 and above

Find the worker process for a Hyper-V VM in 2012 R2 and above

Q. How can I find the process ID for a worker process with Windows Server 2012 R2 Hyper-V and above?

A. To find the process ID for a worker process for Windows Server 2012 R2 and above Hyper-V use the PowerShell below. Note the change from previous versions is the v2 virtualization namespace is used instead of the v1. Note this must run in an elevated PowerShell session or no output will be returned. Replace <VM name> with the actual name of the VM (and don't type the angle brackets).

(Get-WmiObject -q "SELECT * FROM Msvm_ComputerSystem WHERE ElementName = '<VM name>'" -n root\virtualization\v2).ProcessID

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish