# Odd Bitlocker behavior

**URL:** https://forums.powershell.org/t/odd-bitlocker-behavior/17563
**Category:** PowerShell Help
**Created:** [September 17, 2021, 5:34pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563 "2021-09-17T17:34:37Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)
#### Post date: [September 17, 2021, 5:34pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/1 "2021-09-17T17:34:37Z")

</div>

Not sure how to ask this question. If I do this, I get nothing:

```auto
$info = Invoke-Command -ComputerName 'MYCOMPUTER' -ScriptBlock {Get-BitlockerVolume -MountPoint 'C:'}
$info.Keyprotector.RecoveryPassword

```

However, if I do this, I get results:

```auto
$info = Invoke-Command -ComputerName 'MYCOMPUTER' -ScriptBlock {(Get-BitlockerVolume -MountPoint 'C:').Keyprotector.RecoveryPassword}
$info

```

I would like to use the former versus the later. Any ideas on how to make that work?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)
#### Post date: [September 17, 2021, 7:24pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/2 "2021-09-17T19:24:22Z")

</div>

What does $info | Get-Member show? A string or an object?

---

<div class="post-metadata">

### Author: ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)
#### Post date: [September 17, 2021, 7:37pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/3 "2021-09-17T19:37:11Z")

</div>

It appears to be an object:

```auto
PS C:\WINDOWS\system32> $info.GetType()

IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True PSObject System.Object

```

I should point out that I only see this behavior when I query remote systems using Invoke-Command. Everything local works fine.

---

<div class="post-metadata">

### Author: ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)
#### Post date: [September 17, 2021, 10:49pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/4 "2021-09-17T22:49:27Z")

</div>

What were the members?

---

<div class="post-metadata">

### Author: ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)
#### Post date: [September 17, 2021, 10:58pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/5 "2021-09-17T22:58:24Z")

</div>

Sorry about that Krazy Doug ☹

TypeName: Deserialized.Microsoft.BitLocker.Structures.BitLockerVolume

Name MemberType Definition

* * *

GetType Method type GetType()  
ToString Method string ToString(), string ToString(string format, System.IFormatProvider formatPro…  
PSComputerName NoteProperty string PSComputerName=MYCOMPUTER  
PSShowComputerName NoteProperty bool PSShowComputerName=True  
RunspaceId NoteProperty guid RunspaceId=712fcebf-4af3-4652-b46a-1b52e8e71e11  
AutoUnlockEnabled Property {get;set;}  
AutoUnlockKeyStored Property System.Boolean {get;set;}  
CapacityGB Property System.Single {get;set;}  
ComputerName Property System.String {get;set;}  
EncryptionMethod Property System.String {get;set;}  
EncryptionPercentage Property System.Single {get;set;}  
KeyProtector Property Deserialized.System.Collections.ObjectModel.ReadOnlyCollection`1[[Microsoft.BitLoc…  
LockStatus Property System.String {get;set;}  
MetadataVersion Property System.Int32 {get;set;}  
MountPoint Property System.String {get;set;}  
ProtectionStatus Property System.String {get;set;}  
VolumeStatus Property System.String {get;set;}  
VolumeType Property System.String {get;set;}  
WipePercentage Property System.Single {get;set;}

I see the Keyprotector property, but it is empty.

---

<div class="post-metadata">

### Author: ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)
#### Post date: [September 18, 2021, 12:06am UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/6 "2021-09-18T00:06:45Z")

</div>

Hmm that is odd. I’ll have to find a test system.

---

<div class="post-metadata">

### Author: ![Chen.Chen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/chen.chen/32/1689_2.png) [@Chen.Chen](https://forums.powershell.org/u/Chen.Chen)
#### Post date: [September 18, 2021, 1:22am UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/8 "2021-09-18T01:22:24Z")

</div>

Hello Tonyd,

I think that’s the deserialized object problem.  
when you use the invoke-command you will get a deserialized object and it is not the real object.  
you can enter `$info.Keyprotector|gm` to check.  
when you use invoke-command, the type is System.String

 ![image](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/e/e7445de269b8ee5633be83c5afa0fbd0a843b07a.png)

And it dosen’t has the RecoveryPassword property. so you get the empty value.  
if you don’t use the invoke-command,

The type of this object is Microsoft.BitLocker.Structures.BitLockerVolumeKeyProtector  
then you can get the RecoveryPassword property.

so you must put “get Keyprotector.RecoveryPassword” into the -ScriptBlock {}.

---

<div class="post-metadata">

### Author: ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)
#### Post date: [September 18, 2021, 1:34am UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/9 "2021-09-18T01:34:57Z")

</div>

Overlooked deserialized. Great call.

---

<div class="post-metadata">

### Author: ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)
#### Post date: [September 18, 2021, 3:27pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/10 "2021-09-18T15:27:39Z")

</div>

Chen,

Thank you. I will use the second method I posted. Although not desired, I guess I am stuck with it.

Thank you both for the help 🙂

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 8:21pm UTC](https://forums.powershell.org/t/odd-bitlocker-behavior/17563/11 "2024-05-16T20:21:21Z")

</div>


