SlideShare una empresa de Scribd logo
1 de 33
Win32
Introduction to Perl & WMI
WMI?

•   What Means It?
•   Who Made It?
•   What Makes It tick?
•   Where Might I use it for?
Who Made It?
• Set of Standards created by DMTF
 (Desktop Management Task Force   Distributed Management Task Force)
What Means It?
• Set of Standards created by DMTF
  (Desktop Management Task Force   Distributed Management Task Force)



Consisting of:
  DMI (Desktop Management Interface)
  WBEM (Web-Based Entreprise Management)
  CIM (Common Interface Model)

Bundled together known as Windows Meta Instrumentation.
What Makes It tick? (1)
Namespace(s)


Provider       Provider


Class(es)      Class(es)   Class(es)
What Makes It tick? (2)
Namespace(s)


Provider       Provider


Class(es)      Class(es)                      Class(es)



                           WMI Layer


                     COM-API, SCRIPTING API


                            OS Layer
What Makes It tick? (3)
Namespace(s)


Provider                      Provider


Class(es)                     Class(es)                                Class(es)



                                            WMI Layer


                                    COM-API, SCRIPTING API


                                             OS Layer



                                 WMI Classes, Objects & Properties

                                  COM-API, SCRIPTING-API, ...

                     OS Specific Binaries, Registry, WBEM MIF & MOF Files, ...

    NT4        W2K       W2K3              W2K8              XP            Vista   ...
Where Might I use it for?

A Quick & quot;Uniformquot;
     Development Interface
     Reporting Interface
     Device Management Interface
Wow My…It even has a                                                 Wizard ;-)
          quot;Scriptomaticquot;
•   quot;A completely new version of the famous Scriptomatic, the utility that
    writes WMI scripts for you.
    (And, in the process, teaches you the fundamental concepts behind
    writing WMI scripts for yourself.)
•   Unlike its predecessor, Scriptomatic 2.0 isn’t limited to writing just
    VBScript scripts; instead, Scriptomatic 2.0 can write scripts in Perl,
    Python, or JScript as well.
•   In addition, Scriptomatic 2.0 gives you a host of new output formats to
    use when running scripts, including saving data as plain-text, as a
    stand-alone Web page, or even as XML. Scriptomatic 2.0 handles arrays,
    it converts dates to a more readable format, and it works with all the
    WMI classes on your computer; on top of all that, it also writes scripts
    that can be run against multiple machines.“*
    *Quote Microsoft Download Center




    Download: http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119-
    b7eb-783b0f7d1178&DisplayLang=en
Example Perl WMI Query
1.    use strict;
2.    use Win32::OLE('in');

3.    use constant wbemFlagReturnImmediately => 0x10;
4.    use constant wbemFlagForwardOnly => 0x20;

5.    my @computers = (quot;.quot;);
6.    foreach my $computer (@computers) {
7.       my $objWMI = Win32::OLE->GetObject(quot;winmgmts:$computerrootCIMV2quot;)
                      or die quot;WMI connection failed.nquot;;
8.       my $colItems = $objWMI->ExecQuery(quot;SELECT * FROM Win32_NetworkAdapterquot;, quot;WQLquot;,
9.                      wbemFlagReturnImmediately | wbemFlagForwardOnly);

10.     foreach my $objItem (in $colItems) {
11.        print (quot;TimeOfLastReset: quot;
12.               .UTCDate($objItem->{TimeOfLastReset}).quot;nquot;);
13.        print quot;TimeOfLastReset: $objItem->{TimeOfLastReset}nquot;;
14.        print quot;nquot;;
15.     }
16. }

17.   sub UTCDate(){
18.         my $WmiDate = qr/(d{4})(d{2})(d{2})(d{2})(d{2})
19.                        (d{2}).(d{6})([+-])(.*)$
20.                       /ox;
21.      $_[0] =~ s/$WmiDate/$1 $2 $3 $4h $5m $6s (UTC$8$9m)/;
22.      return $_[0];
23.   }
24.   #TimeOfLastReset: 20071027003940.826905+120
25.   #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
Connecting Perl to WMI (1)
• Moniker
1.    use Win32::OLE('in');
2.    use strict;
3.    $strComputer = '.';
4.    $objWMI      = Win32::OLE->GetObject('winmgmts:' . $strComputer .
                     'rootcimv2');




Constructing a Moniker String: http://msdn2.microsoft.com/en-us/library/aa389292.aspx
Connecting Perl to WMI (2)
•      SWBEM Locator
1.     use Win32::OLE('in');
2.     use strict;
3.     my $objWMILocator = Win32::OLE->CreateObject(quot;WbemScripting.SWbemLocatorquot;);
4.     $objWMILocator->Security_->{AuthenticationLevel} = 6;
5.     my $objWMIComputer = $objWMILocator->ConnectServer($strComputer, quot;rootcimv2quot;,
                            $strLocalUser, $strLocalPasswd);




Connecting to WMI on a Remote Computer: http://msdn2.microsoft.com/en-us/library/aa389290.aspx
WQL (SQL for WMI)
                        AND                     NOT
                        ASSOCIATORS OF          NULL
                        FALSE                   OR
                        FROM                    REFERENCES OF
                        GROUP Clause            SELECT
                        HAVING                  TRUE
                        IS                      WHERE
                        ISA                     WITHIN
                        KEYSONLY                __CLASS
                        LIKE




WQL (SQL for WMI): http://msdn2.microsoft.com/en-us/library/aa394606.aspx
WQL - ExecQuery
1.     my $objWMI   = Win32::OLE->GetObject(quot;winmgmts:$computerrootCIMV2quot;)
                      or die quot;WMI connection failed.nquot;;
2.     my $colItems = $objWMI->ExecQuery(quot;SELECT * FROM Win32_NetworkAdapter“,
                      quot;WQLquot;, wbemFlagReturnImmediately | wbemFlagForwardOnly);
3.     foreach my $objItem (in $colItems) {
4.       print ( quot;TimeOfLastReset: quot;
5.              . UTCDate($objItem->{TimeOfLastReset}).quot;nquot;);
6.       print quot;TimeOfLastReset: $objItem->{TimeOfLastReset} nnquot;;
7.     }




Calling a Method: http://msdn2.microsoft.com/en-us/library/aa384832.aspx
WbemFlagEnum: http://msdn2.microsoft.com/en-us/library/Aa393980.aspx
Example Perl WQL ‘Associators Of’
1.    use win32::ole;
2.    use strict;
3.    my $objWMI = Win32::OLE->GetObject('winmgmts:.rootcimv2')
                    or die quot;WMI connection failed.nquot;;
4.    my $colNAs = $objWMI->ExecQuery( 'select * ' . ' from Win32_NetworkAdapter' );
5.    foreach my $objNA( in $colNAs) {
6.        my $colSubNAConfig =
7.             $objWMI->ExecQuery( 'ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID=''
8.                                 . $objNA->DeviceID . ''} '
9.                                 . ' WHERE resultClass = '
10.                                . ' win32_NetworkAdapterConfiguration' );
11.       foreach my $objNAConfig ( in $colSubNAConfig ) {
12.           if ( $objNAConfig->DHCPEnabled == 1 ) {
13.               my $intReturnCode = $objNAConfig->RenewDHCPLease();
14.               if ( $intReturnCode == 0 ) {
15.                    print quot;Renewed IP Configuration for quot;.$objNA->Name ;
16.               }
17.               elsif ( $intReturnCode == 1 ) {
18.                    print quot;You must reboot to renew the IP Configuration for quot;
19.                          .$objNA->Name ;
20.               }
21.           }
22.       }
23.   }
WMI UTC Date/Time (1)
Based on the CIM datetime/interval format
Formatting: yyyymmddHHMMSS.mmmmmmsUUU or yyyy-mm-dd HH:MM:SS:mmm

1.   foreach my $objItem (in $colItems) {
2.         print (quot;TimeOfLastReset: quot;
                  .UTCDate($objItem->{TimeOfLastReset})
3.
4.                .quot;nquot;);
5.         print quot;TimeOfLastReset: $objItem->{TimeOfLastReset}nquot;;
6.         print quot;nquot;;
7.      }
8.   }

9. #TimeOfLastReset: 20071027003940.826905+120
10. #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
WMI UTC Date/Time (2)
Based on the CIM datetime/interval format
Formatting: yyyymmddHHMMSS.mmmmmmsUUU or yyyy-mm-dd HH:MM:SS:mmm


1. sub UTCDate(){
2.      my $WMIDate           =   $_[0];
3.         $WMIDate           =~ s/[^0-9-+]//gis;
4.      my $WmiDateRaw        =   qr/(d{4})(d{2})(d{2})
5.                                   (d{2})(d{2})(d{2})
6.                                   (d{6})([+-])(.*)$
7.                                  /ox;
8.      my $WmiDateFormatted =    qr/(d{4})-?(d{2})-?(d{2})
9.                                   (d{2})(d{2})(d{2})
10.                                  (d{3})$
11.                                 /ox;
12.     if ($WMIDate =~ s/$WmiDateRaw/$1 $2 $3 $4h $5m $6s (UTC$8$9m)/){
13.         return $WMIDate;
14.     };
15.     if ($WMIDate =~ s/$WmiDateFormatted/$1 $2 $3 $4h $5m $6s/){
16.         return $WMIDate;
17.     };
18. }
19. #TimeOfLastReset: 20071027003940.826905+120
20. #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
WMI Practical: ‘Route Print’
1.   use strict;
2.   use Win32::OLE('in');

3.   use constant wbemFlagReturnImmediately => 0x10;
4.   use constant wbemFlagForwardOnly => 0x20;

5.   my $objWMIService = Win32::OLE->GetObject(quot;winmgmts:localhostrootCIMV2quot;)
6.                       or die quot;WMI connection failed.nquot;;

7.  my $colItems = $objWMIService->ExecQuery(quot;SELECT * FROM Win32_IP4RouteTablequot;,
                    quot;WQLquot;,
                    wbemFlagReturnImmediately | wbemFlagForwardOnly);
8.    if (Win32::GetLastError()){
9.    #     Do Error Handling.
10. };
11. print quot;Destinationtquot;.quot;InterfaceIndextquot;.quot;Mask:tquot;.quot;Metric1:tquot;.
          quot;Name:tquot;.quot;NextHop:tquot;.quot;Type:tquot;.quot;Protocol:nquot;;
12. print ‘-’ x 78;

13. foreach my $objItem ( in $colItems) {
14.     print quot;$objItem->{Destination}tquot;;
15.     print sprintf quot;0x%xquot;, $objItem->{InterfaceIndex}.quot;tquot;;
16.     print quot;$objItem->{Mask}t“.quot;$objItem->{Metric1}tquot;;
17.     print quot;$objItem->{Name}t“.quot;$objItem->{NextHop}tquot;;
18.     print quot;$objItem->{Type}t“.print quot;$objItem->{Protocol}nquot;;
19. }
WMI Practical: ‘Route Add’
1.    use Win32::OLE;
2.    use strict;

3.    my $strComputer = '.';
4.    my $objLocator = Win32::OLE->new('WbemScripting.SWbemLocator');
5.    my $objWMI      = $objLocator->ConnectServer($strComputer, 'root/CIMv2');

6.    my $objRoute = $objWMI->Get('Win32_IP4RouteTable')->SpawnInstance_();

7.    $objRoute->{Destination}      =   '0.0.0.0';
8.    $objRoute->{NextHop}          =   '10.10.0.1';
9.    $objRoute->{Mask}             =   '0.0.0.0';
10.   $objRoute->{InterfaceIndex}   =   0x10006;
11.   $objRoute->{Metric1}          =   1;
12.   $objRoute->{Protocol}         =   1;
13.   $objRoute->{Type}             =   4;

14. $objRoute->Put_();

15. if (Win32::GetLastError()){
16.     print quot;WMI Error: quot;.Win32::GetLastError().quot;nquot;;
17.     $intReturnCode &= 0;
18. };

19. #route add 0.0.0.0 MASK 0.0.0.0 10.10.0.1
WMI Practical: ‘Route Delete’
1.     my $objWMI = Win32::OLE->GetObject('winmgmts:.rootcimv2');
2.     for ( my $j = 0; $j < $i; $j++ ) {
3.         #     open and delete local wmi instance
4.         $objWMI->Delete( 'Win32_IP4RouteTable.Destination='‘
                           . $Destination
                           . '',NextHop='‘
                           . $NextHop[$j]
                           . ''' );
5.         if ( Win32::GetLastError() ) {
6.             print quot;Could not delete the route gateway. quot;
7.                   . $NextHop[$j]
8.                   . quot;. WMI Error: quot;
9.                   . Win32::GetLastError() . quot;nquot;;
10.            $intReturnCode &= 0;
11.        }
12.        else {
13.            print quot;Route gateway quot; . $NextHop[$j] . quot; deletedquot; ;
14.            $intReturnCode &= 1;
15.        }
16.    }
WMI Practical: ‘Refreshing quot;PerfMon Dataquot;’
VBS
   PLS
         PL




Accessing Performance Data : http://msdn2.microsoft.com/en-us/library/Aa384728.aspx
WMI Practical: ‘Refreshing’
• VBS (`cscript script.vbs`)
1.   ' Get the performance counter instance for the System process
2.   set Perf = GetObject(quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name=‘0'quot;)
3.   ' Display some properties in a loop
4.   for I = 1 to 5
5.       Wscript.Echo quot;Perf PercentIdleTime = quot; & Perf.PercentIdleTime
6.       Wscript.Sleep 2000
7.   ' Refresh the objects
8.       Perf.Refresh_
9.   next




 C:>cscript Demo_Refresher.vbs
 Microsoft (R) Windows Script Host Version 5.6
 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

 Perf   PercentIdleTime   =   100
 Perf   PercentIdleTime   =
 Perf   PercentIdleTime   =   100
 Perf   PercentIdleTime   =   96
 Perf   PercentIdleTime   =   96

 C:>
WMI Practical: ‘Refreshing’
•     PLS (`cscript script.pls`)
1.     use Win32::OLE qw(in);
2.     use strict;
3.
4.     my $Perf = Win32::OLE->GetObject(
         quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name=‘0'quot;);
5.     for (my $i = 1;$i <= 5 ;$i++){
6.         sleep 5;
7.         $Perf->Refresh_();
8.      print quot;PercentIdleTime: $Perf->{PercentIdleTime}nquot;;
9.     }




    C:>cscript Demo_Refresher.pls
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

    Perf   PercentIdleTime   =   100
    Perf   PercentIdleTime   =
    Perf   PercentIdleTime   =   96
    Perf   PercentIdleTime   =   93
    Perf   PercentIdleTime   =   97

    C:>
WMI Practical: ‘Refreshing’
•     PL (`perl script.pl`)
1.  use Win32::OLE qw(in);
2.    use strict;
3.    for (my $i = 1;$i <= 5 ;$i++){
4.        my $Perf = Win32::OLE->GetObject(
                       quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name='0'quot;);
5.        print quot;PercentIdleTime: $Perf->{PercentIdleTime}nquot;;
6.        $Perf->DESTROY;
7.        $Perf = quot;Unknownquot;;
8.        $Perf = undef;
9.        sleep 2;
10.   };



    C:>perl Demo_Refresher.pl
    PercentIdleTime: 96
    PercentIdleTime: 93
    PercentIdleTime: 100
    PercentIdleTime: 96
    PercentIdleTime: 96

    C:>
WMI Practical: ‘Data Dumping’
•   WQL Query
•   Enumerate WMI object
•   Generate XML Dumps
WMI Practical: ‘WQL Query’
•   Cf. Slide ‘WQL – ExecQuery’
WMI Practical: ‘Enumerate WMI object’
1.    my $strWMIClass = quot;win32_biosquot;;
2.    my $objWMI      = Win32::OLE->GetObject(quot;WinMgmts:quot;)->InstancesOf(quot;win32_biosquot;);
3.    print(   ( '-' x 78 ) . quot;n quot;
4.           . quot;Obtaining that object's data in an enumerated way.nquot;
5.           . ( '-' x 78 ) . quot;nquot; );
6.    my $pad_len = 30;
7.    foreach my $objItem ( in $objWMI) {
8.    print(            sprintf( quot;%-*squot;, $pad_len, quot;WMI Classquot; ) . quot;: quot;
9.                   . $strWMIClass . quot;nquot;
10.                  . sprintf( quot;%-*squot;, $pad_len, quot;Name quot; ) . quot;: quot;
11.                  . sprintf( quot;%-*squot;, $pad_len, $objItem->Name ) . quot;nquot; );
12.       foreach my $objProp ( in $objItem->Properties_ ) {
13.           if ( !( $objProp->Value ) ) {
14.               print( sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: NULLnquot; );
15.           }
16.           elsif ( $objProp->IsArray == 1 ) {
17.               foreach my $i ($objProp) {
18.                   print( sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: quot;
19.                               . $objProp->Value($i) . quot;nquot; );
20.               }
21.           }
22.           elsif ( $objProp->IsArray != 1 ) {
23.               print(        sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: quot;
24.                           . $objProp->Value . quot;nquot; );
25.           }
26.       }
27.     print quot;nquot;;
28.   }
29.   $objWMI->DESTROY;
30.   $objWMI = quot;Unknownquot;;
31.   $objWMI = undef;
WMI Practical: ‘Enumerate WMI object’
WMI Class               :   win32_bios
Name                    :   Phoenix ROM BIOS PLUS Version 1.10 A07
BiosCharacteristics     :
BIOSVersion             :
BuildNumber             :   NULL
Caption                 :   Phoenix ROM BIOS PLUS Version 1.10 A07
CodeSet                 :   NULL
CurrentLanguage         :   en|US|iso8859-1
Description             :   Phoenix ROM BIOS PLUS Version 1.10 A07
IdentificationCode      :   NULL
InstallableLanguages    :   1
InstallDate             :   NULL
LanguageEdition         :   NULL
ListOfLanguages         :
Manufacturer            :   Dell Inc.
Name                    :   Phoenix ROM BIOS PLUS Version 1.10 A07
OtherTargetOS           :   NULL
PrimaryBIOS             :   1
ReleaseDate             :   20070402000000.000000+000
SerialNumber            :   MySerialNbr
SMBIOSBIOSVersion       :   A07
SMBIOSMajorVersion      :   2
SMBIOSMinorVersion      :   4
SMBIOSPresent           :   1
SoftwareElementID       :   Phoenix ROM BIOS PLUS Version 1.10 A07
SoftwareElementState    :   3
Status                  :   OK
TargetOperatingSystem   :   NULL
Version                 :   DELL   - 27d70402
WMI Practical: ‘Generate XML Dumps’
1.    use Win32::OLE qw(in);
2.    use strict;
3.    print(   quot;nquot;
4.           . ( '=' x 78 ) . quot;nquot;
5.           . quot;The following script shows how to obtain an XML representation ofnquot;
6.           . quot;the Win32_Bios class definition.nquot;
7.           . ( '=' x 78 ) . quot;nquot; );
8.    my $objWMI = Win32::OLE->GetObject(quot;winmgmts:win32_biosquot;);
9.    my $XMLDtd = 1;
10.   my $Text    = $objWMI->GetText_($XMLDtd);
11.   print( join( quot;n<PROPERTYquot;, split( /<PROPERTY/, $Text ) ) . quot;nquot; );
12.   $objWMI->DESTROY;
13.   $objWMI = quot;Unknownquot;;
14.   $objWMI = undef;
15.   #-----------------------------------------------------------------------------
16.   print(   ( '=' x 78 ) . quot;nquot;
17.          . quot;By specifying a particular instance of Win32_Bios, you cannquot;
18.          . quot;obtain that object's data.nquot;
19.          . ( '=' x 78 ) . quot;nquot; );
20.   my $strWMIClass = quot;win32_biosquot;;
21.   my $objWMI       = Win32::OLE->GetObject(quot;WinMgmts:quot;)->InstancesOf(quot;win32_biosquot;);
22.   print(   ( '-' x 78 ) . quot;nquot;
23.          . quot;Obtaining that object's data in XML.nquot;
24.          . ( '-' x 78 )
25.          . quot;nquot; );
26.   foreach my $objItem ( in $objWMI) {
27.       my $XMLDtd = 1;
28.       my $Text    = $objItem->GetText_($XMLDtd);
29.       print( join( quot;n<PROPERTYquot;, split( /<PROPERTY/, $Text ) ) . quot;nquot; );
30.   }
WMI Practical: ‘Generate XML Dumps’
<CLASS NAME=quot;Win32_BIOSquot; SUPERCLASS=quot;CIM_BIOSElementquot;>
<PROPERTY NAME=quot;__PATHquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>MyMachineNameROOTcimv2:Win32_BIOS</VALUE></PROPERTY>
<PROPERTY NAME=quot;__NAMESPACEquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>ROOTcimv2</VALUE></PROPERTY>
<PROPERTY NAME=quot;__SERVERquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>MyMachineName</VALUE></PROPERTY>
<PROPERTY.ARRAY NAME=quot;__DERIVATIONquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE.ARRAY><VALUE>CIM_BIOSElement</VALUE><VALUE>CIM_SoftwareElement</VA
    LUE><VALUE>CIM_LogicalElement</VALUE><VALUE>CIM_ManagedSystemElement</VALUE></VALUE.ARR
    AY></PROPERTY.ARRAY>
<PROPERTY NAME=quot;__PROPERTY_COUNTquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;sint32quot;><VALUE>27</VALUE></PROPERTY>
<PROPERTY NAME=quot;__RELPATHquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>Win32_BIOS</VALUE></PROPERTY>
<PROPERTY NAME=quot;__DYNASTYquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>CIM_ManagedSystemElement</VALUE></PROPERTY>
<PROPERTY NAME=quot;__SUPERCLASSquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>CIM_BIOSElement</VALUE></PROPERTY>
<PROPERTY NAME=quot;__CLASSquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>Win32_BIOS</VALUE></PROPERTY>
<PROPERTY NAME=quot;__GENUSquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;sint32quot;><VALUE>1</VALUE></PROPERTY>
<PROPERTY.ARRAY NAME=quot;BiosCharacteristicsquot; CLASSORIGIN=quot;Win32_BIOSquot;
    TYPE=quot;uint16quot;></PROPERTY.ARRAY>
<PROPERTY.ARRAY NAME=quot;BIOSVersionquot; CLASSORIGIN=quot;Win32_BIOSquot;
    TYPE=quot;stringquot;></PROPERTY.ARRAY>
<PROPERTY NAME=quot;BuildNumberquot; CLASSORIGIN=quot;CIM_SoftwareElementquot; PROPAGATED=quot;truequot;
    TYPE=quot;stringquot;></PROPERTY>
<PROPERTY NAME=quot;Captionquot; CLASSORIGIN=quot;CIM_ManagedSystemElementquot; PROPAGATED=quot;truequot;
    TYPE=quot;stringquot;></PROPERTY>
..
TYPE=quot;stringquot;></PROPERTY></CLASS>
WMI Practical: ‘Generate XML Dumps’
<INSTANCE CLASSNAME=quot;Win32_BIOSquot;>
<PROPERTY NAME=quot;__PATHquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>MyMachineNamerootcimv2:Win32_BIOS.Name=quot;Phoenix ROM BIOS PLUS
    Version 1.10 A07quot;,SoftwareElementID=quot;Phoenix ROM BIOS PLUS Version 1.10
    A07quot;,SoftwareElementState=3,TargetOperatingSystem=0,Version=quot;DELL   -
    27d70402quot;</VALUE></PROPERTY>
<PROPERTY NAME=quot;__NAMESPACEquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>rootcimv2</VALUE></PROPERTY>
<PROPERTY NAME=quot;__SERVERquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>MyMachineName</VALUE></PROPERTY>
<PROPERTY.ARRAY NAME=quot;__DERIVATIONquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE.ARRAY><VALUE>CIM_BIOSElement</VALUE><VALUE>CIM_SoftwareElement</VA
    LUE><VALUE>CIM_LogicalElement</VALUE><VALUE>CIM_ManagedSystemElement</VALUE></VALUE.ARR
    AY></PROPERTY.ARRAY>
<PROPERTY NAME=quot;__PROPERTY_COUNTquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;sint32quot;><VALUE>27</VALUE></PROPERTY>
<PROPERTY NAME=quot;__RELPATHquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>Win32_BIOS.Name=quot;Phoenix ROM BIOS PLUS Version 1.10
    A07quot;,SoftwareElementID=quot;Phoenix ROM BIOS PLUS Version 1.10
    A07quot;,SoftwareElementState=3,TargetOperatingSystem=0,Version=quot;DELL   -
    27d70402quot;</VALUE></PROPERTY>
<PROPERTY NAME=quot;__DYNASTYquot; CLASSORIGIN=quot;___SYSTEMquot;
    TYPE=quot;stringquot;><VALUE>CIM_ManagedSystemElement</VALUE></PROPERTY>
..
<PROPERTY NAME=quot;Versionquot; CLASSORIGIN=quot;CIM_SoftwareElementquot; TYPE=quot;stringquot;><VALUE>DELL   -
    27d70402</VALUE></PROPERTY></INSTANCE>
If ( !($WMI) )
•   Dos Executables
•   Perl XS interface to Win32 binaries
ddn123456@gmail.com

Más contenido relacionado

La actualidad más candente

Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019DevClub_lv
 
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutines
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando CoroutinesTDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutines
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutinestdc-globalcode
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruangSanSan Yagyoo
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017名辰 洪
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureFDConf
 
Node.js and angular js
Node.js and angular jsNode.js and angular js
Node.js and angular jsHyungKuIm
 
Reactive, component 그리고 angular2
Reactive, component 그리고  angular2Reactive, component 그리고  angular2
Reactive, component 그리고 angular2Jeado Ko
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A RideBruce Snyder
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptjnewmanux
 
Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)ujihisa
 
ES2015 (ES6) Overview
ES2015 (ES6) OverviewES2015 (ES6) Overview
ES2015 (ES6) Overviewhesher
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기JeongHun Byeon
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJSKyung Yeol Kim
 

La actualidad más candente (20)

Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
 
dSS API by example
dSS API by exampledSS API by example
dSS API by example
 
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutines
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando CoroutinesTDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutines
TDC2018SP | Trilha Kotlin - Programacao assincrona utilizando Coroutines
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruang
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
OneRing @ OSCamp 2010
OneRing @ OSCamp 2010OneRing @ OSCamp 2010
OneRing @ OSCamp 2010
 
Scalable Angular 2 Application Architecture
Scalable Angular 2 Application ArchitectureScalable Angular 2 Application Architecture
Scalable Angular 2 Application Architecture
 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 
Academy PRO: ES2015
Academy PRO: ES2015Academy PRO: ES2015
Academy PRO: ES2015
 
Node.js and angular js
Node.js and angular jsNode.js and angular js
Node.js and angular js
 
Reactive, component 그리고 angular2
Reactive, component 그리고  angular2Reactive, component 그리고  angular2
Reactive, component 그리고 angular2
 
Aimaf
AimafAimaf
Aimaf
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A Ride
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScript
 
ES6 in Real Life
ES6 in Real LifeES6 in Real Life
ES6 in Real Life
 
Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)
 
ES2015 (ES6) Overview
ES2015 (ES6) OverviewES2015 (ES6) Overview
ES2015 (ES6) Overview
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJS
 

Similar a Win32 Perl Wmi

An introduction-to-windows-powershell-1193007253563204-3
An introduction-to-windows-powershell-1193007253563204-3An introduction-to-windows-powershell-1193007253563204-3
An introduction-to-windows-powershell-1193007253563204-3Louis Kolivas
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
WebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTWebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTenpit GmbH & Co. KG
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherMichele Orselli
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)Domenic Denicola
 
Real world cross-platform testing
Real world cross-platform testingReal world cross-platform testing
Real world cross-platform testingPeter Edwards
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Michele Orselli
 
Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Alexander Polce Leary
 
KDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics TutorialKDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics TutorialNeera Agarwal
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
Samsung WebCL Prototype API
Samsung WebCL Prototype APISamsung WebCL Prototype API
Samsung WebCL Prototype APIRyo Jin
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionFelipe Prado
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endEzequiel Maraschio
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSYevgeniy Brikman
 
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski buildacloud
 
Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019julien pauli
 
Browser exploitation SEC-T 2019 stockholm
Browser exploitation SEC-T 2019 stockholmBrowser exploitation SEC-T 2019 stockholm
Browser exploitation SEC-T 2019 stockholmJameel Nabbo
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptCaridy Patino
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Ryan Weaver
 

Similar a Win32 Perl Wmi (20)

An introduction-to-windows-powershell-1193007253563204-3
An introduction-to-windows-powershell-1193007253563204-3An introduction-to-windows-powershell-1193007253563204-3
An introduction-to-windows-powershell-1193007253563204-3
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
WebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTWebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLST
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)
 
Real world cross-platform testing
Real world cross-platform testingReal world cross-platform testing
Real world cross-platform testing
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17
 
Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017
 
KDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics TutorialKDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics Tutorial
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Samsung WebCL Prototype API
Samsung WebCL Prototype APISamsung WebCL Prototype API
Samsung WebCL Prototype API
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECS
 
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
 
Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019
 
Test driven infrastructure
Test driven infrastructureTest driven infrastructure
Test driven infrastructure
 
Browser exploitation SEC-T 2019 stockholm
Browser exploitation SEC-T 2019 stockholmBrowser exploitation SEC-T 2019 stockholm
Browser exploitation SEC-T 2019 stockholm
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)
 

Último

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Win32 Perl Wmi

  • 2. WMI? • What Means It? • Who Made It? • What Makes It tick? • Where Might I use it for?
  • 3. Who Made It? • Set of Standards created by DMTF (Desktop Management Task Force Distributed Management Task Force)
  • 4. What Means It? • Set of Standards created by DMTF (Desktop Management Task Force Distributed Management Task Force) Consisting of: DMI (Desktop Management Interface) WBEM (Web-Based Entreprise Management) CIM (Common Interface Model) Bundled together known as Windows Meta Instrumentation.
  • 5. What Makes It tick? (1) Namespace(s) Provider Provider Class(es) Class(es) Class(es)
  • 6. What Makes It tick? (2) Namespace(s) Provider Provider Class(es) Class(es) Class(es) WMI Layer COM-API, SCRIPTING API OS Layer
  • 7. What Makes It tick? (3) Namespace(s) Provider Provider Class(es) Class(es) Class(es) WMI Layer COM-API, SCRIPTING API OS Layer WMI Classes, Objects & Properties COM-API, SCRIPTING-API, ... OS Specific Binaries, Registry, WBEM MIF & MOF Files, ... NT4 W2K W2K3 W2K8 XP Vista ...
  • 8. Where Might I use it for? A Quick & quot;Uniformquot; Development Interface Reporting Interface Device Management Interface
  • 9. Wow My…It even has a Wizard ;-) quot;Scriptomaticquot; • quot;A completely new version of the famous Scriptomatic, the utility that writes WMI scripts for you. (And, in the process, teaches you the fundamental concepts behind writing WMI scripts for yourself.) • Unlike its predecessor, Scriptomatic 2.0 isn’t limited to writing just VBScript scripts; instead, Scriptomatic 2.0 can write scripts in Perl, Python, or JScript as well. • In addition, Scriptomatic 2.0 gives you a host of new output formats to use when running scripts, including saving data as plain-text, as a stand-alone Web page, or even as XML. Scriptomatic 2.0 handles arrays, it converts dates to a more readable format, and it works with all the WMI classes on your computer; on top of all that, it also writes scripts that can be run against multiple machines.“* *Quote Microsoft Download Center Download: http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119- b7eb-783b0f7d1178&DisplayLang=en
  • 10. Example Perl WMI Query 1. use strict; 2. use Win32::OLE('in'); 3. use constant wbemFlagReturnImmediately => 0x10; 4. use constant wbemFlagForwardOnly => 0x20; 5. my @computers = (quot;.quot;); 6. foreach my $computer (@computers) { 7. my $objWMI = Win32::OLE->GetObject(quot;winmgmts:$computerrootCIMV2quot;) or die quot;WMI connection failed.nquot;; 8. my $colItems = $objWMI->ExecQuery(quot;SELECT * FROM Win32_NetworkAdapterquot;, quot;WQLquot;, 9. wbemFlagReturnImmediately | wbemFlagForwardOnly); 10. foreach my $objItem (in $colItems) { 11. print (quot;TimeOfLastReset: quot; 12. .UTCDate($objItem->{TimeOfLastReset}).quot;nquot;); 13. print quot;TimeOfLastReset: $objItem->{TimeOfLastReset}nquot;; 14. print quot;nquot;; 15. } 16. } 17. sub UTCDate(){ 18. my $WmiDate = qr/(d{4})(d{2})(d{2})(d{2})(d{2}) 19. (d{2}).(d{6})([+-])(.*)$ 20. /ox; 21. $_[0] =~ s/$WmiDate/$1 $2 $3 $4h $5m $6s (UTC$8$9m)/; 22. return $_[0]; 23. } 24. #TimeOfLastReset: 20071027003940.826905+120 25. #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
  • 11. Connecting Perl to WMI (1) • Moniker 1. use Win32::OLE('in'); 2. use strict; 3. $strComputer = '.'; 4. $objWMI = Win32::OLE->GetObject('winmgmts:' . $strComputer . 'rootcimv2'); Constructing a Moniker String: http://msdn2.microsoft.com/en-us/library/aa389292.aspx
  • 12. Connecting Perl to WMI (2) • SWBEM Locator 1. use Win32::OLE('in'); 2. use strict; 3. my $objWMILocator = Win32::OLE->CreateObject(quot;WbemScripting.SWbemLocatorquot;); 4. $objWMILocator->Security_->{AuthenticationLevel} = 6; 5. my $objWMIComputer = $objWMILocator->ConnectServer($strComputer, quot;rootcimv2quot;, $strLocalUser, $strLocalPasswd); Connecting to WMI on a Remote Computer: http://msdn2.microsoft.com/en-us/library/aa389290.aspx
  • 13. WQL (SQL for WMI) AND NOT ASSOCIATORS OF NULL FALSE OR FROM REFERENCES OF GROUP Clause SELECT HAVING TRUE IS WHERE ISA WITHIN KEYSONLY __CLASS LIKE WQL (SQL for WMI): http://msdn2.microsoft.com/en-us/library/aa394606.aspx
  • 14. WQL - ExecQuery 1. my $objWMI = Win32::OLE->GetObject(quot;winmgmts:$computerrootCIMV2quot;) or die quot;WMI connection failed.nquot;; 2. my $colItems = $objWMI->ExecQuery(quot;SELECT * FROM Win32_NetworkAdapter“, quot;WQLquot;, wbemFlagReturnImmediately | wbemFlagForwardOnly); 3. foreach my $objItem (in $colItems) { 4. print ( quot;TimeOfLastReset: quot; 5. . UTCDate($objItem->{TimeOfLastReset}).quot;nquot;); 6. print quot;TimeOfLastReset: $objItem->{TimeOfLastReset} nnquot;; 7. } Calling a Method: http://msdn2.microsoft.com/en-us/library/aa384832.aspx WbemFlagEnum: http://msdn2.microsoft.com/en-us/library/Aa393980.aspx
  • 15. Example Perl WQL ‘Associators Of’ 1. use win32::ole; 2. use strict; 3. my $objWMI = Win32::OLE->GetObject('winmgmts:.rootcimv2') or die quot;WMI connection failed.nquot;; 4. my $colNAs = $objWMI->ExecQuery( 'select * ' . ' from Win32_NetworkAdapter' ); 5. foreach my $objNA( in $colNAs) { 6. my $colSubNAConfig = 7. $objWMI->ExecQuery( 'ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='' 8. . $objNA->DeviceID . ''} ' 9. . ' WHERE resultClass = ' 10. . ' win32_NetworkAdapterConfiguration' ); 11. foreach my $objNAConfig ( in $colSubNAConfig ) { 12. if ( $objNAConfig->DHCPEnabled == 1 ) { 13. my $intReturnCode = $objNAConfig->RenewDHCPLease(); 14. if ( $intReturnCode == 0 ) { 15. print quot;Renewed IP Configuration for quot;.$objNA->Name ; 16. } 17. elsif ( $intReturnCode == 1 ) { 18. print quot;You must reboot to renew the IP Configuration for quot; 19. .$objNA->Name ; 20. } 21. } 22. } 23. }
  • 16. WMI UTC Date/Time (1) Based on the CIM datetime/interval format Formatting: yyyymmddHHMMSS.mmmmmmsUUU or yyyy-mm-dd HH:MM:SS:mmm 1. foreach my $objItem (in $colItems) { 2. print (quot;TimeOfLastReset: quot; .UTCDate($objItem->{TimeOfLastReset}) 3. 4. .quot;nquot;); 5. print quot;TimeOfLastReset: $objItem->{TimeOfLastReset}nquot;; 6. print quot;nquot;; 7. } 8. } 9. #TimeOfLastReset: 20071027003940.826905+120 10. #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
  • 17. WMI UTC Date/Time (2) Based on the CIM datetime/interval format Formatting: yyyymmddHHMMSS.mmmmmmsUUU or yyyy-mm-dd HH:MM:SS:mmm 1. sub UTCDate(){ 2. my $WMIDate = $_[0]; 3. $WMIDate =~ s/[^0-9-+]//gis; 4. my $WmiDateRaw = qr/(d{4})(d{2})(d{2}) 5. (d{2})(d{2})(d{2}) 6. (d{6})([+-])(.*)$ 7. /ox; 8. my $WmiDateFormatted = qr/(d{4})-?(d{2})-?(d{2}) 9. (d{2})(d{2})(d{2}) 10. (d{3})$ 11. /ox; 12. if ($WMIDate =~ s/$WmiDateRaw/$1 $2 $3 $4h $5m $6s (UTC$8$9m)/){ 13. return $WMIDate; 14. }; 15. if ($WMIDate =~ s/$WmiDateFormatted/$1 $2 $3 $4h $5m $6s/){ 16. return $WMIDate; 17. }; 18. } 19. #TimeOfLastReset: 20071027003940.826905+120 20. #TimeOfLastReset: 2007 10 27 00h 39m 40s (UTC+120m)
  • 18. WMI Practical: ‘Route Print’ 1. use strict; 2. use Win32::OLE('in'); 3. use constant wbemFlagReturnImmediately => 0x10; 4. use constant wbemFlagForwardOnly => 0x20; 5. my $objWMIService = Win32::OLE->GetObject(quot;winmgmts:localhostrootCIMV2quot;) 6. or die quot;WMI connection failed.nquot;; 7. my $colItems = $objWMIService->ExecQuery(quot;SELECT * FROM Win32_IP4RouteTablequot;, quot;WQLquot;, wbemFlagReturnImmediately | wbemFlagForwardOnly); 8. if (Win32::GetLastError()){ 9. # Do Error Handling. 10. }; 11. print quot;Destinationtquot;.quot;InterfaceIndextquot;.quot;Mask:tquot;.quot;Metric1:tquot;. quot;Name:tquot;.quot;NextHop:tquot;.quot;Type:tquot;.quot;Protocol:nquot;; 12. print ‘-’ x 78; 13. foreach my $objItem ( in $colItems) { 14. print quot;$objItem->{Destination}tquot;; 15. print sprintf quot;0x%xquot;, $objItem->{InterfaceIndex}.quot;tquot;; 16. print quot;$objItem->{Mask}t“.quot;$objItem->{Metric1}tquot;; 17. print quot;$objItem->{Name}t“.quot;$objItem->{NextHop}tquot;; 18. print quot;$objItem->{Type}t“.print quot;$objItem->{Protocol}nquot;; 19. }
  • 19. WMI Practical: ‘Route Add’ 1. use Win32::OLE; 2. use strict; 3. my $strComputer = '.'; 4. my $objLocator = Win32::OLE->new('WbemScripting.SWbemLocator'); 5. my $objWMI = $objLocator->ConnectServer($strComputer, 'root/CIMv2'); 6. my $objRoute = $objWMI->Get('Win32_IP4RouteTable')->SpawnInstance_(); 7. $objRoute->{Destination} = '0.0.0.0'; 8. $objRoute->{NextHop} = '10.10.0.1'; 9. $objRoute->{Mask} = '0.0.0.0'; 10. $objRoute->{InterfaceIndex} = 0x10006; 11. $objRoute->{Metric1} = 1; 12. $objRoute->{Protocol} = 1; 13. $objRoute->{Type} = 4; 14. $objRoute->Put_(); 15. if (Win32::GetLastError()){ 16. print quot;WMI Error: quot;.Win32::GetLastError().quot;nquot;; 17. $intReturnCode &= 0; 18. }; 19. #route add 0.0.0.0 MASK 0.0.0.0 10.10.0.1
  • 20. WMI Practical: ‘Route Delete’ 1. my $objWMI = Win32::OLE->GetObject('winmgmts:.rootcimv2'); 2. for ( my $j = 0; $j < $i; $j++ ) { 3. # open and delete local wmi instance 4. $objWMI->Delete( 'Win32_IP4RouteTable.Destination='‘ . $Destination . '',NextHop='‘ . $NextHop[$j] . ''' ); 5. if ( Win32::GetLastError() ) { 6. print quot;Could not delete the route gateway. quot; 7. . $NextHop[$j] 8. . quot;. WMI Error: quot; 9. . Win32::GetLastError() . quot;nquot;; 10. $intReturnCode &= 0; 11. } 12. else { 13. print quot;Route gateway quot; . $NextHop[$j] . quot; deletedquot; ; 14. $intReturnCode &= 1; 15. } 16. }
  • 21. WMI Practical: ‘Refreshing quot;PerfMon Dataquot;’ VBS PLS PL Accessing Performance Data : http://msdn2.microsoft.com/en-us/library/Aa384728.aspx
  • 22. WMI Practical: ‘Refreshing’ • VBS (`cscript script.vbs`) 1. ' Get the performance counter instance for the System process 2. set Perf = GetObject(quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name=‘0'quot;) 3. ' Display some properties in a loop 4. for I = 1 to 5 5. Wscript.Echo quot;Perf PercentIdleTime = quot; & Perf.PercentIdleTime 6. Wscript.Sleep 2000 7. ' Refresh the objects 8. Perf.Refresh_ 9. next C:>cscript Demo_Refresher.vbs Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Perf PercentIdleTime = 100 Perf PercentIdleTime = Perf PercentIdleTime = 100 Perf PercentIdleTime = 96 Perf PercentIdleTime = 96 C:>
  • 23. WMI Practical: ‘Refreshing’ • PLS (`cscript script.pls`) 1. use Win32::OLE qw(in); 2. use strict; 3. 4. my $Perf = Win32::OLE->GetObject( quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name=‘0'quot;); 5. for (my $i = 1;$i <= 5 ;$i++){ 6. sleep 5; 7. $Perf->Refresh_(); 8. print quot;PercentIdleTime: $Perf->{PercentIdleTime}nquot;; 9. } C:>cscript Demo_Refresher.pls Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Perf PercentIdleTime = 100 Perf PercentIdleTime = Perf PercentIdleTime = 96 Perf PercentIdleTime = 93 Perf PercentIdleTime = 97 C:>
  • 24. WMI Practical: ‘Refreshing’ • PL (`perl script.pl`) 1. use Win32::OLE qw(in); 2. use strict; 3. for (my $i = 1;$i <= 5 ;$i++){ 4. my $Perf = Win32::OLE->GetObject( quot;winmgmts:Win32_PerfFormattedData_PerfOS_Processor.name='0'quot;); 5. print quot;PercentIdleTime: $Perf->{PercentIdleTime}nquot;; 6. $Perf->DESTROY; 7. $Perf = quot;Unknownquot;; 8. $Perf = undef; 9. sleep 2; 10. }; C:>perl Demo_Refresher.pl PercentIdleTime: 96 PercentIdleTime: 93 PercentIdleTime: 100 PercentIdleTime: 96 PercentIdleTime: 96 C:>
  • 25. WMI Practical: ‘Data Dumping’ • WQL Query • Enumerate WMI object • Generate XML Dumps
  • 26. WMI Practical: ‘WQL Query’ • Cf. Slide ‘WQL – ExecQuery’
  • 27. WMI Practical: ‘Enumerate WMI object’ 1. my $strWMIClass = quot;win32_biosquot;; 2. my $objWMI = Win32::OLE->GetObject(quot;WinMgmts:quot;)->InstancesOf(quot;win32_biosquot;); 3. print( ( '-' x 78 ) . quot;n quot; 4. . quot;Obtaining that object's data in an enumerated way.nquot; 5. . ( '-' x 78 ) . quot;nquot; ); 6. my $pad_len = 30; 7. foreach my $objItem ( in $objWMI) { 8. print( sprintf( quot;%-*squot;, $pad_len, quot;WMI Classquot; ) . quot;: quot; 9. . $strWMIClass . quot;nquot; 10. . sprintf( quot;%-*squot;, $pad_len, quot;Name quot; ) . quot;: quot; 11. . sprintf( quot;%-*squot;, $pad_len, $objItem->Name ) . quot;nquot; ); 12. foreach my $objProp ( in $objItem->Properties_ ) { 13. if ( !( $objProp->Value ) ) { 14. print( sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: NULLnquot; ); 15. } 16. elsif ( $objProp->IsArray == 1 ) { 17. foreach my $i ($objProp) { 18. print( sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: quot; 19. . $objProp->Value($i) . quot;nquot; ); 20. } 21. } 22. elsif ( $objProp->IsArray != 1 ) { 23. print( sprintf( quot;%-*squot;, $pad_len, $objProp->Name ) . quot;: quot; 24. . $objProp->Value . quot;nquot; ); 25. } 26. } 27. print quot;nquot;; 28. } 29. $objWMI->DESTROY; 30. $objWMI = quot;Unknownquot;; 31. $objWMI = undef;
  • 28. WMI Practical: ‘Enumerate WMI object’ WMI Class : win32_bios Name : Phoenix ROM BIOS PLUS Version 1.10 A07 BiosCharacteristics : BIOSVersion : BuildNumber : NULL Caption : Phoenix ROM BIOS PLUS Version 1.10 A07 CodeSet : NULL CurrentLanguage : en|US|iso8859-1 Description : Phoenix ROM BIOS PLUS Version 1.10 A07 IdentificationCode : NULL InstallableLanguages : 1 InstallDate : NULL LanguageEdition : NULL ListOfLanguages : Manufacturer : Dell Inc. Name : Phoenix ROM BIOS PLUS Version 1.10 A07 OtherTargetOS : NULL PrimaryBIOS : 1 ReleaseDate : 20070402000000.000000+000 SerialNumber : MySerialNbr SMBIOSBIOSVersion : A07 SMBIOSMajorVersion : 2 SMBIOSMinorVersion : 4 SMBIOSPresent : 1 SoftwareElementID : Phoenix ROM BIOS PLUS Version 1.10 A07 SoftwareElementState : 3 Status : OK TargetOperatingSystem : NULL Version : DELL - 27d70402
  • 29. WMI Practical: ‘Generate XML Dumps’ 1. use Win32::OLE qw(in); 2. use strict; 3. print( quot;nquot; 4. . ( '=' x 78 ) . quot;nquot; 5. . quot;The following script shows how to obtain an XML representation ofnquot; 6. . quot;the Win32_Bios class definition.nquot; 7. . ( '=' x 78 ) . quot;nquot; ); 8. my $objWMI = Win32::OLE->GetObject(quot;winmgmts:win32_biosquot;); 9. my $XMLDtd = 1; 10. my $Text = $objWMI->GetText_($XMLDtd); 11. print( join( quot;n<PROPERTYquot;, split( /<PROPERTY/, $Text ) ) . quot;nquot; ); 12. $objWMI->DESTROY; 13. $objWMI = quot;Unknownquot;; 14. $objWMI = undef; 15. #----------------------------------------------------------------------------- 16. print( ( '=' x 78 ) . quot;nquot; 17. . quot;By specifying a particular instance of Win32_Bios, you cannquot; 18. . quot;obtain that object's data.nquot; 19. . ( '=' x 78 ) . quot;nquot; ); 20. my $strWMIClass = quot;win32_biosquot;; 21. my $objWMI = Win32::OLE->GetObject(quot;WinMgmts:quot;)->InstancesOf(quot;win32_biosquot;); 22. print( ( '-' x 78 ) . quot;nquot; 23. . quot;Obtaining that object's data in XML.nquot; 24. . ( '-' x 78 ) 25. . quot;nquot; ); 26. foreach my $objItem ( in $objWMI) { 27. my $XMLDtd = 1; 28. my $Text = $objItem->GetText_($XMLDtd); 29. print( join( quot;n<PROPERTYquot;, split( /<PROPERTY/, $Text ) ) . quot;nquot; ); 30. }
  • 30. WMI Practical: ‘Generate XML Dumps’ <CLASS NAME=quot;Win32_BIOSquot; SUPERCLASS=quot;CIM_BIOSElementquot;> <PROPERTY NAME=quot;__PATHquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>MyMachineNameROOTcimv2:Win32_BIOS</VALUE></PROPERTY> <PROPERTY NAME=quot;__NAMESPACEquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>ROOTcimv2</VALUE></PROPERTY> <PROPERTY NAME=quot;__SERVERquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>MyMachineName</VALUE></PROPERTY> <PROPERTY.ARRAY NAME=quot;__DERIVATIONquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE.ARRAY><VALUE>CIM_BIOSElement</VALUE><VALUE>CIM_SoftwareElement</VA LUE><VALUE>CIM_LogicalElement</VALUE><VALUE>CIM_ManagedSystemElement</VALUE></VALUE.ARR AY></PROPERTY.ARRAY> <PROPERTY NAME=quot;__PROPERTY_COUNTquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;sint32quot;><VALUE>27</VALUE></PROPERTY> <PROPERTY NAME=quot;__RELPATHquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>Win32_BIOS</VALUE></PROPERTY> <PROPERTY NAME=quot;__DYNASTYquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>CIM_ManagedSystemElement</VALUE></PROPERTY> <PROPERTY NAME=quot;__SUPERCLASSquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>CIM_BIOSElement</VALUE></PROPERTY> <PROPERTY NAME=quot;__CLASSquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>Win32_BIOS</VALUE></PROPERTY> <PROPERTY NAME=quot;__GENUSquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;sint32quot;><VALUE>1</VALUE></PROPERTY> <PROPERTY.ARRAY NAME=quot;BiosCharacteristicsquot; CLASSORIGIN=quot;Win32_BIOSquot; TYPE=quot;uint16quot;></PROPERTY.ARRAY> <PROPERTY.ARRAY NAME=quot;BIOSVersionquot; CLASSORIGIN=quot;Win32_BIOSquot; TYPE=quot;stringquot;></PROPERTY.ARRAY> <PROPERTY NAME=quot;BuildNumberquot; CLASSORIGIN=quot;CIM_SoftwareElementquot; PROPAGATED=quot;truequot; TYPE=quot;stringquot;></PROPERTY> <PROPERTY NAME=quot;Captionquot; CLASSORIGIN=quot;CIM_ManagedSystemElementquot; PROPAGATED=quot;truequot; TYPE=quot;stringquot;></PROPERTY> .. TYPE=quot;stringquot;></PROPERTY></CLASS>
  • 31. WMI Practical: ‘Generate XML Dumps’ <INSTANCE CLASSNAME=quot;Win32_BIOSquot;> <PROPERTY NAME=quot;__PATHquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>MyMachineNamerootcimv2:Win32_BIOS.Name=quot;Phoenix ROM BIOS PLUS Version 1.10 A07quot;,SoftwareElementID=quot;Phoenix ROM BIOS PLUS Version 1.10 A07quot;,SoftwareElementState=3,TargetOperatingSystem=0,Version=quot;DELL - 27d70402quot;</VALUE></PROPERTY> <PROPERTY NAME=quot;__NAMESPACEquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>rootcimv2</VALUE></PROPERTY> <PROPERTY NAME=quot;__SERVERquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>MyMachineName</VALUE></PROPERTY> <PROPERTY.ARRAY NAME=quot;__DERIVATIONquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE.ARRAY><VALUE>CIM_BIOSElement</VALUE><VALUE>CIM_SoftwareElement</VA LUE><VALUE>CIM_LogicalElement</VALUE><VALUE>CIM_ManagedSystemElement</VALUE></VALUE.ARR AY></PROPERTY.ARRAY> <PROPERTY NAME=quot;__PROPERTY_COUNTquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;sint32quot;><VALUE>27</VALUE></PROPERTY> <PROPERTY NAME=quot;__RELPATHquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>Win32_BIOS.Name=quot;Phoenix ROM BIOS PLUS Version 1.10 A07quot;,SoftwareElementID=quot;Phoenix ROM BIOS PLUS Version 1.10 A07quot;,SoftwareElementState=3,TargetOperatingSystem=0,Version=quot;DELL - 27d70402quot;</VALUE></PROPERTY> <PROPERTY NAME=quot;__DYNASTYquot; CLASSORIGIN=quot;___SYSTEMquot; TYPE=quot;stringquot;><VALUE>CIM_ManagedSystemElement</VALUE></PROPERTY> .. <PROPERTY NAME=quot;Versionquot; CLASSORIGIN=quot;CIM_SoftwareElementquot; TYPE=quot;stringquot;><VALUE>DELL - 27d70402</VALUE></PROPERTY></INSTANCE>
  • 32. If ( !($WMI) ) • Dos Executables • Perl XS interface to Win32 binaries