public static void main(String[] args) throws Exception
{
String vmName = "Rawc1.2_Win7x32bit_Target";
ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"), "administrator", "vmware", true);
VirtualMachine vm = (VirtualMachine) new InventoryNavigator(si.getRootFolder()).searchManagedEntity("VirtualMachine", vmName);
VirtualMachineDeviceManager vmdm = new VirtualMachineDeviceManager(vm);
vmdm.createNetworkAdapter(VirtualNetworkAdapterType.VirtualE1000, "dvPortGroup", "00:50:56:00:12:14", true, true);