How to ping mac address to get ip5/19/2023 I needed to get the MAC address of all our remote computers so I could use Wake up on Lan to remotely power them up.īecause most computers have multiple interfaces I needed to know which was the ethernet adapter in use.Ī quick bit of code did the trick. I know this thread is old but this may help others. This basically "connects" to a remote computer, specified by the ComputerName and queries WMI for getting all the Mac Address where the NIC's are enabled on that computer, it then returns back the results and you should see it go through each result and showing you the Mac Address on that computer from the results returned back MessageBox.Show(currentResult("MacAddress").ToString()) Get()įor each currentResult as ManagementObject in theResultsCollection Be sure to import the System.Management and namespaces to do thisĭim theManagementScope as new ManagementScope("\\"
0 Comments
Leave a Reply. |