use Win32::OLE('in'); use strict; my $stepOk = 1; my $errorMsg = ""; my $wmiService = ""; my $computer = "."; # Computer to connect to: . = local host my $namespace = "\\root\\cimV2"; # Namespace to connect to my @classes = (); $wmiService = Win32::OLE->GetObject("winmgmts:\\\\".$computer.$namespace); my $subDevices = $wmiService->SubclassesOf(); foreach my $subDevProp ( in( $subDevices ) ) { print "Class $count: ".$subDevProp->{Path_}->{Path}."\n"; if($subDevProp->{Path_}->{Path} =~ /.*:(.*)/) { my $class = $1; print "Detected class: $class\n"; push(@classes,$class); } } # Scripted by jschollen # Thanks to the Microsoft Scripting Guys