Package com.drighetto.wmicom4j.wmijtd

Examples of com.drighetto.wmicom4j.wmijtd.ISWbemObject


      System.out.println("=> Perform a query : What logical disks do we have ?");
      // Select informations
      ISWbemObjectSet result = wbemServices.execQuery("Select * from Win32_LogicalDisk", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : What USB drives do we have ? */
      System.out.println("=> Perform a query : What USB drives do we have ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_USBDevice", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : What is the datetime ? */
      System.out.println("=> Perform a query : What is the datetime ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_LocalTime", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : How many logon session do we have ? */
      System.out.println("=> Perform a query : How many logon session do we have ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_LogonSession", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : How many share do we have ? */
      System.out.println("=> Perform a query : How many share do we have ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_Share", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : How many network connection do we have ? */
      System.out.println("=> Perform a query : How many network connection do we have ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_NetworkConnection", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

      /* Perform a query : How many account SID do we have ? */
      System.out.println("=> Perform a query : How many account SID do we have ?");
      // Select informations
      result = wbemServices.execQuery("Select * from Win32_AccountSID", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        System.out.println(wo.getObjectText_(0));
      }

    } catch (Exception e) {
      e.printStackTrace();
    } finally {
View Full Code Here


      /*Perform a query*/
      // Select informations
      ISWbemObjectSet result = wbemServices.execQuery("Select * from Win32_USBDevice", "WQL", 16, null);
      // Display query results
      for (Com4jObject obj : result) {
        ISWbemObject wo = obj.queryInterface(ISWbemObject.class);
        wo.getObjectText_(0);
      }
      System.out.println("=> Test OK !");
      /*Release object*/
      wbemServices.dispose();   
      System.out.println("=> Object released !");
View Full Code Here

TOP

Related Classes of com.drighetto.wmicom4j.wmijtd.ISWbemObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.