use strict; use warnings; use Win32::OLE (); my $computer = '.'; my $obj = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\cimv2") or die("$^E\n"); my $devices = $obj->InstancesOf("Win32_NetworkAdapter"); foreach my $device (Win32::OLE::in $devices) { my $adapter_type = $device->{AdapterType}; next unless defined $adapter_type && $adapter_type eq 'Ethernet 802.3'; print 'Win32_NetworkAdapter ', $device->{ Index }, $/, $device->{ DeviceID }, $/, $device->{ PNPDeviceID }, $/, $device->{ Name }, $/, $device->{ Description }, $/, $device->{ ProductName }, $/, $device->{ Manufacturer }, $/, $device->{ MACAddress }, $/, $/; }