pdqcom / PowerShell-Scanners

A community repository of PowerShell Scanners for PDQ Inventory.
MIT License
179 stars 74 forks source link

Get Bitlocker Status failing #84

Closed lukebarone closed 2 years ago

lukebarone commented 2 years ago

Powershell code:

#Requires -Modules BitLocker
Get-BitLockerVolume

Output:

Return code: -37104

WARNING: The names of some imported commands from the module 'BitLocker' include unapproved verbs that might make them 
less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose 
parameter. For a list of approved verbs, type Get-Verb.
Get-BitLockerVolumeInternal : Device Id: \\?\Volume{06f17754-e9fb-448c-9d61-46b2169b00e7}\ does not have a 
corresponding volume.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitLocker\BitLocker.psm1:697 char:89
+ ... iveLetter) {Get-BitLockerVolumeInternal -MountPoint $_.DriveLetter} e ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Get-BitLockerVolumeInternal

PDQ Inventory version 19.3.254.0 in Enterprise Mode. Target machines are all Windows 10 x64 Education 2004 and 20H2.

Weird thing is, same image, and other computers are scanning just fine. The Device ID part is the same for 70 computers, while it works fine for the other 30.

PDQDakota commented 2 years ago

If you open PowerShell as an admin on one of the affected devices and run Get-BitLockerVolume does it return the same error?

If the same error occurs, there is a volume that is encountering some sort of issue that's throwing off how Get-BitLockerVolume recognizes Bitlocker information for a given volume. That's not something we can fix as it's an OS environment/Bitlocker module problem, neither we can control and I, personally, wouldn't know how to fix it. I'd recommend discovering what that 06f17754-e9fb-448c-9d61-46b2169b00e7 volume is and taking it from there if the command fails when you run it outside of PDQ Inventory.

Let us know otherwise.

lukebarone commented 2 years ago

Unfortunately, I get the same error when logging in locally :-/ Alright, I'll look to Microsoft and their fantastic support... /s

lukebarone commented 2 years ago

So in my case, it was because the "Microsoft Storage Spaces SMP" service was disabled.

Hopefully that helps someone in the future.