Solved

Powershell Hyper-V Module on Server 2012 R2

Posted on 2014-10-14
2
529 Views
Last Modified: 2014-11-12
I don't use powershell very much and I don't know if it's just me - but it seems every time I need to use powershell (and I always happen to be on different versions of Windows server) that something is different and even though I documented how I did something last time, it simply doesn't work in all cases.

Here's where I'm stuck today...

I'm on a Windows Server 2012 R2 machine, it has the Hyper-V role installed (and has running VM machines)


I'm trying to get a list of all VM's and the virtual network that their NIC is connected to.

But my issue is at the very basics, I can't even get output from "Get-VM"

I type it in, and nothing happens (no error, but no output, I just end up at the next line)

PS C:\> Get-VM
PS C:\>


If I type this:
Get-Command –Module Hyper-V

I get a list of all the Cmdlet's, for example:


CommandType     Name                                               ModuleName
-----------     ----                                               ----------
Cmdlet          Add-VMDvdDrive                                     Hyper-V
Cmdlet          Add-VMFibreChannelHba                              Hyper-V
Cmdlet          Add-VMHardDiskDrive                                Hyper-V
Cmdlet          Add-VMMigrationNetwork                             Hyper-VCommandType     Name                                               ModuleName
-----------     ----                                               ----------
Cmdlet          Add-VMDvdDrive                                     Hyper-V
Cmdlet          Add-VMFibreChannelHba                              Hyper-V
Cmdlet          Add-VMHardDiskDrive                                Hyper-V
Cmdlet          Add-VMMigrationNetwork                             Hyper-V
...etc

Open in new window




Just in case, I also imported the Hyper-V module like this:

PS C:\> Import-Module “C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Hyper-V\Hyper-V.psd1”
PS C:\>


Here is the Powershell version info:

PS C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34011
BuildVersion                   6.3.9600.16394
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

Open in new window




So what am I missing?  If the Hyper-V module wasn't installed I assume typing Get-VM would give me an error, but it doesn't, yet it doesn't give any output either.

Also, if you can advise on the full command to list all VM's and their virtual switches that would be helpful too.


Thanks in advance
0
Comment
Question by:Vas
2 Comments
 
LVL 5

Accepted Solution

by:
Abdul Khadja Alaoudine earned 500 total points
ID: 40379666
Are you running PowerShell as administrator? If not, make sure you running it as administrator.
0
 
LVL 1

Author Comment

by:Vas
ID: 40379698
OMG that was it thank you!

Wow Microsoft could have at least added some kind of permissions error instead of nothing, they have no issues spitting out errors in Powershell for everything else.


Thanks Abdul.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now