Get Network details of Hyper V Virtual Machine
-
יום חמישי 01 מרץ 2012 14:08
Hi,
How to get Network details of a Hyper V Virtual machine using powershell
I need to get the IP Address, Gateway, Subnetmask, DNS details.
Any help is appreciated. Thanks in advance.
Regards,
-Hari
כל התגובות
-
יום חמישי 01 מרץ 2012 15:12
Download and use the Powershell Management Module for Hyper-V from CodePlex, here:
Grant Ward, a.k.a. Bigteddy
- סומן כתשובה על-ידי IamMredMicrosoft Employee, Owner יום שני 05 מרץ 2012 03:10
-
יום חמישי 01 מרץ 2012 15:39if the machine is network connected, you can also use the Win32_NetworkAdapterConfiguration class with a remote WMI call to the machine to get the data.
- סומן כתשובה על-ידי IamMredMicrosoft Employee, Owner יום שני 05 מרץ 2012 03:10
- סימון כתשובה בוטל על-ידי .Net-Hari יום שני 05 מרץ 2012 04:40
-
יום שני 05 מרץ 2012 04:41
Thanks for the replay.
Is there any direct method in powershell to get this?
Regards,
-Hari
-
יום שני 05 מרץ 2012 04:57
Hi .Net-Hari. By direct, I assume you mean built-in. Did you try using:
gwmi win32_networkadapterconfiguration -computername VM1
?
Grant Ward, a.k.a. Bigteddy
-
יום שני 05 מרץ 2012 12:12
Win32_NetworkAdapterConfiguration in WMI is the most "direct" way to obtain this information that is native to Windows.
gwmi Win32_NetworkAdapterConfiguration -ComputerName VM1 | ? { $_.IPAddres s -ne $null } | select *
- נערך על-ידי thepip3r יום שני 05 מרץ 2012 12:13
-
יום שלישי 06 מרץ 2012 06:57
Hi, Thanks for the replays.
I can only use virtualization api's or snapin's here. No direct WMI (Win32_*) calls.
Here the problem is Get-VM cmdlet does'nt give this for me.
-Hari
-
יום שלישי 06 מרץ 2012 07:00