Using WMI Methods

Started by bettman, September 10, 2014, 10:18:48 AM

Previous topic - Next topic

bettman

Greetings,

Could you briefly outline how to invoke a method from a WMI class? Specifcally I am trying to use the GetConversionStatus method of the Win32_EncryptableVolume class to determine what the status of the encryption process is on a workstation.

Any help would be appreciated.

Thank you.

td

Here is an example while not showing the specific member you mentioned do demonstrate using the class:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/WMI+Win32_EncryptableVolume.txt

The Tech Database has a whole section devoted to WMI topics including script creation tools.  Just click on the Tech Database menu item at the top of this page -> click the left-hand-side WinBatch -> scroll down -> click WMI.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bettman

In the example you provided, which line refers to the method? (as you can tell I really don't have a good understanding of WMI)

Thank you for your help.

td

As mentioned previously there isn't a call to the method but it would look something like the following

Code (winbatch) Select

   ; ... example's code .....

   If objInstance.ProtectionStatus == 1
      strStatus = "PROTECTION ON"
      nEncryptionPercentage = 0  ; Out
      nEncryptionFlags = 0  ; Out
      nWipingStatus = 0  ; Out
      nWipingPercentage = 0  ; Out
      nPrecisionFactor = 2  ; In/out (1 - 4)
      objInstance.GetConversionStatus( nEncryptionPercentage, nEncryptionFlags, nWipingStatus , nWipingPercentage, nPrecisionFactor) 
  EndIf

  ; Handle out parameters of method call in whatever fashion requirements dictate.



The class documentation can be found here

http://msdn.microsoft.com/en-us/library/aa376433(v=vs.85).aspx
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade