Okay first here is my code
Code:
 Global $Macs[], $Ports[]

Open (1,"C:\bin\templist.txt")
open (2, "C:\bin\cam.txt")
open (3, "C:\bin\mapping.txt", 5)

$t = Readline(1)
Close (1)
$List = Split($t,",")

$r = Readline(2)
$c = 0
While @Error = 0
Redim Preserve $Macs[$c]
Redim Preserve $Ports[$c]

$array = Split($r," ")
$Change = Split($array[1],"-")
$Macs[$c] = $Change[0]+":"+$Change[1]+":"+$Change[2]+":"+$Change[3]+":"+$Change[4]+":"+$Change[5]
$Ports[$c] = $array[2]
$c = $c + 1
$r = Readline(2)
loop
Close(2)

For each $computer in $list
$Object = GetObject("winmgmts:\\" + $Computer + "\root\CIMV2")
$Items = $Object.ExecQuery("SELECT * FROM Win32_NetworkAdapter")
For each $thing in $items
$Mac = $thing.MACAddress
CheckMac($mac, $Computer)
Next
next
close (3)
Exit(1)


Function CheckMac($mac, $Computer)

For $i = 0 to Ubound($Macs)

If $Macs[$i] = $Mac
WriteLine(3, "Server = "+$Computer+ " Port = "+$Ports[$i]+ "With the MAC of -"+$mac+@CRLF)
Endif

Next

EndFunction



The issue is that there is more than one adaptor on each of my servers, and I am only getting the first one listed. How do I read the remainder ones?

TempList = Name of servers in a CSV file.

Cam File = a dump from a Cisco Switch that gives me a MAC to Port listing.
_________________________
Today is the tomorrow you worried about yesterday.