Re: Where is \root\cimv2\Security\MicrosoftVolumeEncryption?



On May 1, 10:10 am, OldDog <mikef2...@xxxxxxxxxxx> wrote:
On Apr 30, 10:01 pm, OldDog <mikef2...@xxxxxxxxxxx> wrote:





On Apr 30, 1:59 pm, OldDog <mikef2...@xxxxxxxxxxx> wrote:

Hi,

I have seen references to this class on TechNet, however when I check
my WMI classes on Vista Enterprise, I do not see it. I don't see
Security listed at all. Is there something I need to do to use this
class??

OldDog

By using the WMI browser I found the elusive \root\cimv2\Security
\MicrosoftVolumeEncryption class.
So it's there, just kind of hidden. In any event, all that it will
show me is the encryptable volumes.
What I am really looking for is a way to determine if BitLocker is
enabled and running on a machine.
Via a script, of course. Any ideas?

OldDog

I found this on the intertubes; one problem it reports 0 (zero) for
status regardless of the actual state;

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2\Security\MicrosoftVolumeEncryption")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_EncryptableVolume",,48)

For Each objItem in colItems
        Wscript.Echo "DeviceID: " & objItem.DeviceID
        Wscript.Echo "DriveLetter: " & objItem.DriveLetter
        Wscript.Echo "EncryptionMethod: " & objItem.GetEncryptionMethod
        Wscript.Echo "ProtectionStatus: " & objItem.GetProtectionStatus
        Wscript.Echo "ConversionStatus: " & objItem.GetConversionStatus
Next

I think this is on the right track, just something is missing.

OldDog- Hide quoted text -

- Show quoted text -

So I added an "if" statement that restricts the view to the system
drive ( C: ) %99.9 of the time.

<-------------- Start Script ----------------------------------->
strComputer = "."
Set oShell = CreateObject("WScript.Shell")
strSDL = oShell.ExpandEnvironmentStrings("%SystemDrive%")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2\Security\MicrosoftVolumeEncryption")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_EncryptableVolume",,48)

For Each objItem in colItems
If objItem.DriveLetter = strSDL then
WScript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "DriveLetter: " & objItem.DriveLetter
Wscript.Echo "EncryptionMethod: " & objItem.GetEncryptionMethod
Wscript.Echo "ProtectionStatus: " & objItem.GetProtectionStatus
Wscript.Echo "ConversionStatus: " & objItem.GetConversionStatus
End If
Next

<------------ End Script -------------------------->

Be carefull of the wrap, it's a killer.
I still have the issue where it reports a 0 (zero) for all three
objects.

Still working on it.

OldDog

.



Relevant Pages

  • Re: use different Roaming Profiles depending on OS
    ... Set colItems = objWMIService.ExecQuery("Select * from ... For Each objItem in colItems ... I have only the opportunity to leave the profil ptah blank or set an profile path. ...
    (microsoft.public.windows.server.active_directory)
  • Re: temperature disque dur
    ... have you a peace of code for mesure temperature of a disque please ... Set colItems = objWMIService.ExecQuery("Select * from ... For Each objItem in colItems ...
    (microsoft.public.scripting.wsh)
  • Help with WMI script reading from TXT file
    ... of servers.txt is not online then strcomputer stays as the sever on line 7 ... For Each objItem in colItems ... Set colItems = objWMIService.ExecQuery("Select * from ...
    (microsoft.public.scripting.vbscript)
  • Find Calendar Item from Location
    ... Public Function OutLookCode() ... Set colItems = objFolder.Items ... For Each objItem In colItems ... strTest = objItem.Subject ...
    (microsoft.public.outlook.program_vba)
  • Re: Time Error
    ... I also get the correct time when I run the Time command in a command ... Set colItems = objWMIService.ExecQuery(_ ... For Each objItem in colItems ... DaylightName = Eastern Daylight Time ...
    (microsoft.public.windowsxp.general)