The dpmhv-showVMNICs command displays all Network Interface Cards (NIC) in the VM on a Hyper-V host.
This command has the following format:
dpmhv-showVMNICs -vm vmname|-vmid vmguid -host hostname [-retval] [-silent] [-detail]
Specifies the name of the VM.
Specifies the unique ID of the VM.
Specifies the name of the Hyper-V server host.
Returns a value for further processing.
Specifies not to direct the output to the screen.
(Optional) Displays the details of the list of NICs.
The dpmhv-showVMNICs command returns the objects.
The following properties are returned in regular mode:
The following properties are returned in detail mode:
Example: Show VM NIC Information
This example shows the information of the NICs of the VM, "TestVM" on the host "hvserver."
dpmhv-showVMNICs -host hvserver -vm TestVM
//Find virtual network the first adapter of a VM is connected To
anic = dpmhv-showVMNICs -host hvserver -vm TestVM -detail -silent -retval
lines = anic[0].Connection.split(",");
for each(line in lines)
{
if(line.startsWith("SystemName="))
{
nsw = line.substr(11);
nsw = nsw.trim('"');
break;
}
}
// Get switches
asw = dpmhv-getHostSwitches -host hvserver -silent -retval
// Find match
for each(sw in asw)
{
if(sw.Name == nsw)
{
?? "NIC",anic[0].ElementName
? " is connected to switch", sw.ElementName
}
}
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |