title: Get Link Speed - Win32_PerfRawData_Tcpip_NetworkInterface
body: <p>I found <a href="https://stackoverflow.com/questions/849728/determining-the-network-connection-link-speed">Determining the network connection link speed</a> 
  and now I am trying to correlate the data from <strong>Win32_PerfRawData_Tcpip_NetworkInterface</strong> with
  <strong>Win32_NetworkAdapter</strong> (or <strong>Win32_NetworkAdapterConfiguration</strong>).</p>
  
  <p>On the class <code>Win32_PerfRawData_Tcpip_NetworkInterface</code> I don't see any
  index or unique key that I can use to reference
  <code>Win32_NetworkAdapterConfiguration</code> or <code>Win32_NetworkAdapter.
  I tried to use the</code>Name<code>in</code>Win32_PerfRawData_Tcpip_NetworkInterface<code>
  and</code>Win32_NetworkAdapter`, but still they look different.</p>
  
  <p>e.g.</p>
  
  <blockquote>
    <p>Name: Intel(R) PRO/1000 PL Network
    Connection</p>
  </blockquote>
  
  <p>vs</p>
  
  <blockquote>
    <p>Name: Intel[R] PRO_1000 PL Network
    Connection</p>
  </blockquote>
  
  <p>Any hints?</p>
  
  <p>Thank you in advance,</p>
  
  <p>Milde</p>
  
  <p>===</p>
  
  <p>Maybe that piece of code will help you to help me guys :)</p>
  
  <pre><code># I got the DeviceID of a NIC and use it to get the "NetConnection ID":
  
  $objWMIService = Win32::OLE-&gt;GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "Exit: WMI connection failed. \n";
  $colNicSetts = $objWMIService-&gt;ExecQuery(
                "SELECT * FROM Win32_NetworkAdapter Where DeviceID = '$ID'", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
  
  foreach my $objItem (in $colNicSetts){
      $NetConnID = $objItem-&gt;{NetConnectionID};    
  }
  
  # =&gt; $NetConnID stores "Intel(R) PRO/1000 PL Network Connection".
  # Now I tried to get the Link Speed with sth. like that:
  
  $collItems = $objWMIService-&gt;ExecQuery(
               "SELECT * FROM Win32_PerfRawData_Tcpip_NetworkInterface Where Name = '$NetConnID'", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
  foreach my $objItem (in $collItems){
      $LinkSpeed = $objItem-&gt;{CurrentBandwidth};
  }
  # "Win32_PerfRawData_Tcpip_NetworkInterface" contains "Intel[R] PRO_1000 PL Network" Connection
  # "Intel(R) PRO/1000 PL Network Connection" != Intel[R] PRO_1000 PL Network Connection
  # =&gt; $LinkSpeed empty
  </code></pre>