Home > OS >  Win2012 virtual machine in the hyper - v card information failure
Win2012 virtual machine in the hyper - v card information failure

Time:10-27

I on obtaining win2012 the hyper - v virtual machine in the network information, can't get connection attribute's value, the following code

ManagementObjectCollection address_set=m_settings. GetRelated (" Msvm_SyntheticEthernetPortSettingData ");
List Nicinfo=new List (a);
Foreach (ManagementObject enic in address_set)
{
String [] connections=(string []) enic (" Connection ");
}

Connections without access to any information, began to suspect that uac control problems, then close the uac or getting less than,

In addition, I query the hyper - v virtual machine switches also fail when information:

String query=the string. Format (" Select * From Msvm_VirtualSwitch ");
ManagementObjectSearcher searcher=new ManagementObjectSearcher (scope, new ObjectQuery (query));
ManagementObjectCollection virtualSwitchs=a searcher. The Get ();
ManagementObject virtualSwitch=null;
Foreach (ManagementObject instance in virtualSwitchs)
{
VirtualSwitch=instance;
break;
}

Visit virtualSwitchs. The Count will throw an exception, and there is no access to VirtualSwitch doubt is the query,

The most important of all, the above two problems, the same code run on win2008 completely no problem,
  • Related