title: How can I retrieve the LAN adapter MAC address?
body: <p>I want to retrieve the MAC address from a Windows system, only for LAN Adapter. Can you suggest to me how I'd handle this in VBScript?</p>
  
  <p>I'm currently using this VBScript for getting the MAC address, but this is giving me results for all adapters, while I only want the MAC address when I am connected with LAN Adapter.</p>
  
  <pre><code>strComputer = "."
  Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\CIMV2")
  Set colItems = objWMIService.ExecQuery _
      ("Select * from Win32_NetworkAdapterConfiguration") 
  For Each objItem in colItems
    If objItem.ServiceName &lt;&gt; "VMnetAdapter" AND isNull(objItem.MACAddress)=0 Then  
      Wscript.Echo objItem.MACAddress
      Wscript.Echo objItem.ServiceName
    End if
  Next
  </code></pre>