I have a small problem and need some help. We need to quickly find the MAC addresses of machines and all we have is the hostname.
We have been using the getmac /s \\computername command to get the mac address of a single hostname.
I have a text file which has lots of hostnames in it (150) one per line e.g.
I am using the following command
getmac /s hostname1 /u domain\user /p password /fo csv /nh >> ThisFile.txt
My question is, is there anyway to loop through the file using each line of the file as the hostname for example in the form of a variable. I'm not too hot with batch scripting so not great with loops any help would be much appreciated!!