Win32::WMIC - Access to the MS Windows Management Instrumentation Utility!
Version 0.01
WMIC extends WMI for operation from several command-line interfaces and through batch scripts. Understand?
Essentially, MS Windows captures a crap-load of information about the system, users, hadware, etc and now makes it available via the wmic command-line utility.
See this URL for more details: [last checked Mon Dec 28 21:42:44 2009 ] http://technet.microsoft.com/en-us/library/bb742610.aspx
Use it in Perl...
use Win32::WMIC; my $wmic = Win32::WMIC->new(); my $csv = $wmic->query('process list')->data; # get processes my $data = $wmic->parse;
the `new` method is used to instantiate a new Win32-WMIC object
new arguments
no arguments
new usage and syntax
my $wmic = Win32::WMIC->new; takes 0 arguments example: my $wmic = Win32::WMIC->new;
the `query` method is used to issue commands against the wmic utility
query arguments
query usage and syntax
$wmic->query($query); takes 1 argument 1st argument - required $query - a single valid wmic command string example: my $query = 'useraccount list breif'; $wmic->query($query);
the `data` method is used to output the raw unprocessed resultset returned from the wmic query
data arguments
data usage and syntax
$wmic->data; takes 0 arguments example: my $raw_resultset = $wmic->data;
the `parse` method is used to produce a perl object from the wmic query resultset
parse arguments
parse usage and syntax
my $data = $wmic->parse; takes 2 arguments 1st argument - optional $where - a SQL::Abstract hashref where-clause construct 2nd argument - optional $order - a SQL::Abstract arrayref order-clause construct example: my $data = $wmic->parse;
Al Newkirk, <awncorp at cpan.org>
<awncorp at cpan.org>
Please report any bugs or feature requests to bug-win32-wmic at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32-WMIC. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-win32-wmic at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Win32::WMIC
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Win32-WMIC
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Win32-WMIC
CPAN Ratings
http://cpanratings.perl.org/d/Win32-WMIC
Search CPAN
http://search.cpan.org/dist/Win32-WMIC/
Copyright 2009 Al Newkirk, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Win32::WMIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::WMIC
CPAN shell
perl -MCPAN -e shell install Win32::WMIC
For more information on module installation, please visit the detailed CPAN module installation guide.