#!/usr/local/perl use Win32::OLE('in'); use strict; # Variables my $stepOk = 1; my $errorMsg = ""; my $wmiService = ""; my $computer = "."; # Computer to connect to: . = local host my @nameSpaces = (); enumNameSpaces("root"); sub enumNameSpaces { my $nameSpaceStr = shift; print $nameSpaceStr."\n"; push(@nameSpaces,$nameSpaceStr); $wmiService = Win32::OLE->GetObject("winmgmts:\\\\".$computer."\\".$ +nameSpaceStr); ($stepOk = 0) unless $wmiService; if(! $stepOk) { $errorMsg = "Unable to open wmi services"; print $errorMsg."\n"; } my $subDevices = $wmiService->InstancesOf("__NAMESPACE"); foreach my $subDevProp ( in( $subDevices ) ) { enumNameSpaces($nameSpaceStr."\\".$subDevProp->{Name}); } } # Scripted by jschollen # Thanks to the Microsoft Scripting Guys
In reply to WMI: Namespaces by jschollen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |