VMware Cloud Community
johnjohnjjj
Contributor
Contributor

unable to connect to a "Microsoft Hyper-V Server 2012" using the "Connect-VIServer " command

i have many ESX hosts servers which i can connect to using the following commnad:-

>>Connect-VIServer

and i can retrieve their info and their VMs info using the following commands without any problem:-

>>Get-VMHost

>>Get-VM


but when i try to execute the Connect-VIServer on a "Microsoft Hyper-V Server 2012" server, i got the following error:-


>>Connect-VIServer   

Network connectivity error occured. Please verify that the network address and port are correct.

here is the screen shot :-

vi.png

so can anyone adivce why i am unable to connect to MS hyper-v server in the same way i do for the ESX ? and if i manage to connect to it will i be able to run Get-VMHost & Get-VM power cli scripts on "MS hyper-v" ?

Thanks

Reply
0 Kudos
4 Replies
ccalvetTCC
Enthusiast
Enthusiast

Connect-viserver

This cmdlet establishes a connection to a vCenter Server system.

vSphere 6.0 Documentation Center

So you can connect to a vCenter or to an ESXi host with this command.

It means no hyperV

However i guess that you will find command to do similar things in the hyper-V world...but you will need to go to a microsoft forum to get more information.

Blog: http://thecrazyconsultant.com/ | Twitter: @ccalvetTCC
Reply
0 Kudos
johnjohnjjj
Contributor
Contributor

thanks for the info . but you mean i can find PowerCli commands for the hyper-v servers ? or i will be running the commands from outside the powercli command line ?

Thanks

Reply
0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee

Yes. PowerCLI is specific to VMware. In order to connect to Hyper V, I believe, you can use PowerShell (By MS)


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

Reply
0 Kudos
ccalvetTCC
Enthusiast
Enthusiast

PowerCLI "just extends" PowerShell to provide a way to manage VMware products.

There are others modules specifically for hyper-V that will "extend" Powershell to manage microsoft products.

https://technet.microsoft.com/en-us/library/hh848559.aspx

And you have there a "get-vm" specifically for Hyper-V

It is always possible to load any modules from a PowerShell session.

So instead of starting "PowerCLI" you can start PowerShell and load all Modules and SnapIn associated to PowerCLI

From the same session you can also load all "hyper-V" modules or snapin associated to Hyper-V

However, i will not recommend it.

I don't know how PowerShell will react with two commands with the exact same name. (Get-VM in both case)

To keep it simple use PowerCLI when managing VMware

Use PowerShell + Hyper-V modules when managing Hyper-V

Blog: http://thecrazyconsultant.com/ | Twitter: @ccalvetTCC
Reply
0 Kudos