Created
December 16, 2017 16:22
-
-
Save mchubby/43309ac879db58563c63e4856f3a3a11 to your computer and use it in GitHub Desktop.
Query Bitlocker status Powershell/WMI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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