Previous Topic: CA Microsoft Hyper-V AutoShell CommandsNext Topic: dpmhv-addVMSCSIController (Cmdlet) Command--Add SCSI Controllers to a VM


dpmhv-addVMNic (Cmdlet) Command--Add a Network Interface Controller to a VM

The dpmhv-addVMNic command lets you add network adapter to a VM and provides an option to connect it to a virtual switch.

This command has the following format:

dpmhv-addVMNic 
-host hostname 
-vm vmname|-vmid vmguid 
[-mac_address macaddress]
[-switch switchname]
[-legacy]
[-retval] 
[-silent]
-host hostname

Specifies the name of the Hyper-V server host.

-vm vmname

Specifies the name of the VM.

-vmid vmguid

Specifies the unique ID of the VM.

-mac_address macaddress

(Optional) Defines the MAC address of the new network adapter. Valid entry: 12 digit hexadecimal values (for example, A-F, 0-9, a-f) in the format: 0013724C2140 or 00:13:72:4C:21:40.

Note: If the macaddress is not specified, Hyper-V automatically generates it.

-switch switchname

Specifies the virtual network switch name to connect the network adapter of the VM. If you do not specify this option, the network adapter of the VM is not connected to the virtual network.

Default: None

-legacy

(Optional) Creates legacy network adapter instead of Hyper-V synthetic adapter.

Note: Use this option when installing operating systems that do not have Hyper-V integration services.

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

Example: Add a Network Interface Controller to a VM

This example adds NIC to a VM," TestVM."

dpmhv-addVMNic 
-host hvserver 
-vm TestVM 
-switch "Local Area Connection 
- Virtual Network"