The big problem is that Windows does not enumerate installed NICs in any particular order. This is a common issue with server configuration. Assuming you're configuring the server manually (which is what we normally do), you can just shut/no shut the ports to see which is connected to what.
If you need your NICs enumerated in a particular order, one trick that I use is to map the ports as described above, then in device manager, delete the NICs that are enumerated incorrectly. When Windows re-installs the NICs they will be randomly assigned again. After doing this a few times while not touching ones that are in the correct order, the enumeration will be correct.
If you need a scriptable NIC enumeration capability, Kelvin Wong has done some work with this using WMI queries to look through the registry. Note that NIC settings in the registry require you to cross-reference multiple entries in different locations, so it will require some work on your part to ensure your script is designed properly.