I want to get a list of all the interfaces, IP and MAC address on a machine. I have quite a few machines to get this information from (around 600) and I can't use a batch file on the devices. I would like to send the command and get back an echoed output.
All the info I need is in ipconfig /all
but I am not sure how to go about parsing that out with a for loop. I am still quite new to that complex of a loop. Essentially I need to get a one liner output if possible. Any suggestions?
hostname, interface1 name, IP, Mac, interface2 name, ip mac,...
etc.
EDIT:
I have had some luck with the WMIC
outputs but I am having issues getting it to display correctly in a file. If I run these.
wmic computersystem get name
wmic nic where netenabled=true get netconnectionID
wmic /output:C:\wmictest.csv nicconfig where IPEnabled=True get ipaddress, macaddress /format:csv
My output does not show the netconnectionID
. Also the output file as a blank line before the text. not a big deal but is odd. Any suggestions on how to get all the info into the file correctly? here is my example output.
Node,IPAddress,MACAddress
U8001674-TPL-A,{10.91.35.84;fe80::52b:9817:6bbf:dca4},F0:1F:AF:2A:5E:B5
Here is a
wmic
solution resulting withecho =!HostName!,!NetConID!,!IP_Addrs!,!MAC_Addr!
with one line for each active adapter of a local computer (can't try adaptations necessary to run it against a remote machine):Another solution parses semi-linear output from
ipconfig /ALL
and gives results closest to previouswmic
one as follows: