Unanswered How is primary MAC address defined?

  • Monday, January 21, 2013 7:25 AM
     
     
    Actually the question: how does MDT defines primary MAC address of the computer? How does it know that it's not WIFI or other?

All Replies

  • Monday, January 21, 2013 9:09 AM
     
      Has Code

    MDT will via WMI and vbscript go through the class Win32_NetworkAdapterConfiguration and list all the networkadapters that have an IP-address asigned to it. As the wireless network adapter cant connect to the wireless network during PXE MDT wont get its mac address.

    Same thing but with powershell:

    All networkadapters:

    Get-WmiObject Win32_NetworkAdapterConfiguration

    All networkadapters with an IP:

    Get-WmiObject Win32_NetworkAdapterConfiguration | where {$_.ipenabled -EQ $true}

    All MACaddresses for networkadapters with an IP:

    (Get-WmiObject Win32_NetworkAdapterConfiguration | where {$_.ipenabled -EQ $true}).Macaddress

    From ZTIGather.wsf

    ' Get a list of IP-enabled adapters
    
    		Set objNetworkAdapters = objWMI.ExecQuery("select * from Win32_NetworkAdapterConfiguration where IPEnabled = 1")
    
    		For Each objAdapter In objNetworkAdapters
    
    			oLogging.CreateEntry "Checking network adapter: " & objAdapter.Caption, LogTypeInfo
    
    			' Get the MAC address
    
    			If not dicMacAddresses.Exists(objAdapter.MacAddress) then
    				dicMacAddresses.Add objAdapter.MacAddress, ""
    			End if
    			oLogging.CreateEntry "MAC address = " & objAdapter.MacAddress, LogTypeInfo

    Why are wondering? :)


    • Edited by Samus-Aran Monday, January 21, 2013 10:57 AM
    •  
  • Monday, January 21, 2013 11:42 AM
     
     

    Thanks for the reply,

    But what happens when you run deployment script from real OS like XP or Win 7 and WIFI is connected?

  • Monday, January 21, 2013 12:03 PM
     
     

    Hi, no problem when you run deployment a real OS and Wifi is connected. Before post: "wireless network adapter cant connect to the wireless network during PXE MDT"

    What is the problem exactly? 

  • Monday, January 21, 2013 12:13 PM
     
      Has Code

    Hi Algil,

    The order is usually the same as the LAN order in the network section in the control panel. I suggest looking at the ztigather.log file on one of your machines. Here's an exert from one of my machines

    Getting network info
    Checking network adapter: [00000011] Realtek PCIe GBE Family Controller	ZTIGather
    MAC address = D0:27:88:xx:xx:xx	
    IP Address = 10.0.0.169	
    IP Address = fe80::74a5:1a40:a164:6c9	
    Default Gateway = 10.0.0.1	
    Checking network adapter: [00000014] VMware Virtual Ethernet Adapter for VMnet1
    MAC address = 00:50:56:xx:xx:xx	
    IP Address = 192.168.116.1	
    IP Address = fe80::4c4b:208e:76a3:8e91	
    Checking network adapter: [00000016] VMware Virtual Ethernet Adapter for VMnet8	
    MAC address = 00:50:56:xx:xx:xx	
    IP Address = 192.168.119.1	
    IP Address = fe80::f583:2e37:92cb:bc17	
    Property IPAddress001 is now = 10.0.0.169	
    Property IPAddress002 is now = fe80::74a5:1a40:a164:6c9	
    Property IPAddress003 is now = 192.168.116.1	
    Property IPAddress004 is now = fe80::4c4b:208e:76a3:8e91	
    Property IPAddress005 is now = 192.168.119.1	
    Property IPAddress006 is now = fe80::f583:2e37:92cb:bc17	
    Property MacAddress001 is now = D0:27:88:xx:xx:xx	
    Property MacAddress002 is now = 00:50:56:xx:xx:xx	
    Property MacAddress003 is now = 00:50:56:xx:xx:xx	
    Property DefaultGateway001 is now = 10.0.0.1	
    Finished getting network info	
    

    It would also help if you explain what problem you are having and we can advise how to avoid it. MDT will enumerate all IP enabled adapters. In the case of a re-image then the newly installed WIFI card would not usually lease an IP unless configured to do so.

    If you're just doing your research at this stage I suggest having a read of this thread http://social.technet.microsoft.com/Forums/en-US/mdt/thread/7960861d-55df-44af-85bb-51ff5a26bc60/

    /Andrew


    Blog: http://scriptimus.wordpress.com

  • Monday, January 21, 2013 7:50 PM
     
     

    Thank you guys for bothering to answer my question.

    Let me try to make myself as much clear as I can.

    1. I'm not having any problem with MDT

    2. What I'm trying to do is to prepare pretty big bunch of computers to be reimaged. For this purpose we want to gather inventory information by running our home made WMI based application , but, as you may be already understand, we are having problem with some of computers reporting incorrectly the primary MAC address.

    As you understand, it's much easier to image computers when you have all their data in MDT DB, but, again, if the data is not correct - the imaging is not running.

    Thank to Samus-Aran who pointed to part of ZTIGather.wsf script - it pretty much answered my question, but I'm still not sure it makes it the right way in case computer has multiple network connection active:  Wi-Fi, VPN, regular LAN adapter etc.

  • Monday, January 21, 2013 9:33 PM
     
     

    The only other advice I can offer is, I suggest you run a ZTIGather on the machines you are unsure about. This will show you what MDT will definitely recognise as the primary adapter.

    /Andrew



    Blog: http://scriptimus.wordpress.com