How do I query the extended values of GetConversionStatus of the Win32_EncryptableVolume Class
I am using WMI to determine the Bitlocker Status. However, I need to go deeper than just W32_EncryptableVolume. There is a variable called GetConversionStatus described in a MSDN article (http://msdn.microsoft.com/en-us/library/windows/desktop/aa376433(v=vs.85).aspx)
and I don't know how to generate a query to get these values.
Any assistance is appreciated!
I should mention I would like to see these in an application like WMI Explorer so I am looking for the Query string.
May 8th, 2012 4:12pm
Hi,
Since WMI is a part of development tool of MSDN, I suggest to contact MSDN forum for further help:
http://social.msdn.microsoft.com/Forums/en-US/category/windowsdesktopdev
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and
other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
Thank you for your understanding.
Regards,
Leo
Huang
TechNet Subscriber Support
If you are
TechNet Subscription user and have any feedback on our support quality, please send your feedback
here.Leo Huang
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
May 8th, 2012 10:21pm
If you look at your link you will see that there is an example of how to get that at the bottom of the page.
You just need to modify the code a bit.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume",,48)
Dim arEncryptionMethod
arEncryptionMethod = Array("None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256")
Dim arProtectionStatus
arProtectionStatus = Array("Protection Off", "Protection On", "Protection Unknown")
Dim arConversionStatus
arConversionStatus = Array("Fully Decrypted", "Fully Encrypted", "Encryption In Progress", "Decryption In Progress", "Encryption Paused", "Decryption Paused")
Dim arLockStatus
arLockStatus = Array("Unlocked", "Locked")
For Each objItem in colItems
Dim EncryptionMethod
Dim ProtectionStatus
Dim ConversionStatus
Dim EncryptionPercentage 'Percentage of the volume that is encrypted
Dim VolumeKeyProtectorID
Dim LockStatus
objItem.GetEncryptionMethod EncryptionMethod
objItem.GetProtectionStatus ProtectionStatus
objItem.GetConversionStatus ConversionStatus, EncryptionPercentage
objItem.GetKeyProtectors 0,VolumeKeyProtectorID
objItem.GetLockStatus LockStatus
' you need to set condition here
'for example if you are checking only C drive
if objItem.DriveLetter = "C" then
'if objItem.DriveLetter = "C" and arConversionStatus(ConversionStatus)="Fully Encrypted" then
WScript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "DriveLetter: " & objItem.DriveLetter
Wscript.Echo "EncryptionMethod: " & arEncryptionMethod(EncryptionMethod)
Wscript.Echo "ProtectionStatus: " & arProtectionStatus(ProtectionStatus)
Wscript.Echo "ConversionStatus: " & arConversionStatus(ConversionStatus)
Wscript.Echo "EncryptionPercentage: " & EncryptionPercentage & "%"
Wscript.Echo "LockStatus: " & arLockStatus(LockStatus)
'stop looping
exit for
End if
Next
May 9th, 2012 1:34am
Brano, Thank you. I see how that could work perfectly. However, for what I am doing I have to Query this directly. BigFix uses Relevance code that says If WMI\ROOT\CIV...= STRING=VALUE is TRUE then take action. So I need to know what "string" I can use to
validate the units n iW32_EncryptableVolume. Could you speak to that?
Thanks,
Matt
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2012 8:08am
Sorry i am not sure if am following you and i am not familiar with BigFix.
I think you may need convert this code above into a function.
The function should return what ever you are expecting in your BigFix.
WMI\ROOT\CIV...= STRING=VALUE
if STRING=fSample() then
' do first thing
else
'do second thing
end if
function fSample()
return strResults
end function.
May 9th, 2012 2:53pm
Brano, BigFix is like SCCM.
Either way, it determines if a device requires a fix by using what it calls "Relevance" code. This can check the values of WMI, registry, etc. directly without having to run a VBS. Based on the values returned, it can then decide if the computer is "Relevant"
to the fix/action that those values apply to.
For example: Say I want to resume Bitlocker on a device in which it was suspended. To determine if Bitlocker was suspended I can tell BigFix "only apply this action to devices where String
ProtectionStatus of Class Win32_EncryptableVolume in root\cimv2\Security\MicrosoftVolumeEncryption is 0" This would generate a response of TRUE and run the action.
However, I need more information. Which I can only get from drilling down deeper, in to a Method under
Win32_EncryptableVolue called GetConversionStatus. I need to see what the values of
EncryptionPercentage and ConversionStatus are without running a VB script.
Free Windows Admin Tool Kit Click here and download it now
May 9th, 2012 3:17pm