Skip to content

Instantly share code, notes, and snippets.

@mchubby
Created December 16, 2017 16:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchubby/43309ac879db58563c63e4856f3a3a11 to your computer and use it in GitHub Desktop.
Save mchubby/43309ac879db58563c63e4856f3a3a11 to your computer and use it in GitHub Desktop.
Query Bitlocker status Powershell/WMI
gwmi("Win32_EncryptableVolume") -namespace "root\CIMV2\Security\MicrosoftVolumeEncryption"
Get-CimInstance -Namespace root/CIMV2/Security/MicrosoftVolumeEncryption -ClassName Win32_EncryptableVolume
gwmi("Win32_EncryptableVolume") -namespace "root\CIMV2\Security\MicrosoftVolumeEncryption" -Filter "DriveLetter = 'O:'"
gwmi("Win32_EncryptableVolume") -namespace "root\CIMV2\Security\MicrosoftVolumeEncryption" | foreach {
$obj = $_
$status = $obj.InvokeMethod("GetLockStatus", $null, $null)
Add-Member -InputObject $obj -MemberType NoteProperty -Name LockStatus -Value $status.LockStatus
$obj
} | Select-Object -Property DriveLetter,LockStatus,DeviceID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment