1

Running the following command on a fresh Hyper-V 2012 server:

get-wmiobject -namespace “rootvirtualization” -Query “select * from Msvm_ConcreteJob”

produces this errorerror:

Get-WmiObject : Invalid namespace "rootvirtualization"
At line:1 char:1
+ Get-WmiObject -Namespace "rootvirtualization" -Query "Select * from Msvm_concret ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

I'm lost as to what the issue would be, shouldn't this namespace be part of a standard Hyper-V install? Is there some powershell module I need to install?

Nexus
  • 850
  • 1
  • 8
  • 19
  • Is that a literal copy/paste of your code? Those aren't normal double quotes in the `Get-WmiObject` command. If it is copied [from a blog post](http://tritoneco.com/2013/01/25/view-progress-of-hyper-v-snapshot-merge/) try: `Get-WmiObject -Namespace "rootvirtualization" -Query "select * from Msvm_ConcreteJob"` instead. – jscott May 09 '13 at 00:10
  • Nicely spotted jscott, I did get the command from a blog (and pasted it in the question), but I'm typing it in manually on the server. I just tried to copy/paste your version, same result. – Nexus May 09 '13 at 00:11
  • [This Technet magazine post](http://technet.microsoft.com/en-us/magazine/dd722740.aspx) shows the namespace as `root\Virtualization` which makes more sense to me. Could you try `Get-WmiObject -Namespace "root\virtualization" -Query "select * from Msvm_ConcreteJob"` Here is [a TechNet blog](http://blogs.technet.com/b/benp/archive/2008/01/29/listing-wmi-namespaces-installed-on-a-host.aspx) which details how to list the available namespaces. If the above command fails, check the namespaces to see what's available. – jscott May 09 '13 at 01:01
  • That did it! Thanks jscott -- please add an answer and I'll flag it correct. – Nexus May 09 '13 at 01:21

1 Answers1

1

It seems a backslash is missing from the namespace path. Rather than "rootvirtualization" the path should be "root\virtualization"

UPDATE: For 2012 R2 the namespace is "root\virtualization\v2"

Nexus
  • 850
  • 1
  • 8
  • 19
jscott
  • 24,484
  • 8
  • 79
  • 100