If you want to script the creation of a new VM in Windows 2012 Hyper-V (and possibly Azure) using the New-VM cmdlet you have to run a Powershell session with elevated privileges (Run as Administrator) in order for the command to work even if you are already a member of the local admins group.
Running the command in a normal session will present you with the nice red error:
“You do not have permission to perform the operation or the Virtual machine Management Service is not running on the target computer or installation has been corrupted”
Perhaps more intriguing is the error you get when you try and run the Remove-VM command without Administrator privileges:
“The parameter is not valid. Hyper-V was unable to find a virtual machine with name ……..”
It’s not that any parameter is invalid, it’s just that without Admin privileges the command can’t find the VMs.
Annoyingly the Technet article about the New-VM command at :
makes no mention of needing elevated privileges to perform these commands.
It’s a fairly obvious thing to try when you see errors like this but you can still waste a chunk of time making sure that that is the real problem.
A chunk of time I’ll never get back but hopefully this will save someone else some time.