I'm trying to parse the output of ipconfig /all to retrieve the first MAC address that is not part of a VM adapter and the second byte should not be 50. A sample return is as follows: I'm able to retrieve just the MAC addresses and I'm able to discard them if 50 is in the second byte, but how do I determine if the word 'VMware' is in the immediately preceding description field and if so, enforce that no match is made.
Thanks.
Regular Expression:
..{2}-(?!50).{2}-.{2}-.{2}-.{2}-.{2}
Windows IP Configuration
Host Name . . . . . . . . . . . . : ws-remote
Primary Dns Suffix . . . . . . . : nothing.com
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : nothing.com
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.222.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.17.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : SiS 900 PCI Fast Ethernet Adapter
Physical Address. . . . . . . . . : 00-0A-E6-AD-4B-B7
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.200
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.10
DNS Servers . . . . . . . . . . . : 192.168.0.10
Lease Obtained. . . . . . . . . . : Sunday, November 02, 2003 8:44:31 AM
Lease Expires . . . . . . . . . . : Monday, November 10, 2003 8:44:31 AM