Find computers in domain without Bitlocker info

BCR 41 Reputation points
2022-05-30T06:38:42.267+00:00

Hi!

We are seeking for a powershell command that would list which domain joined computers don't have bitlocker keys stored in AD.
with best regards

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,823 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
0 comments No comments
{count} votes

Accepted answer
  1. MTG 1,241 Reputation points
    2022-05-31T09:09:19.707+00:00

    Better use this which makes use of the attribute pwdlastset (which gets replicated alright across all DCs)

    Import-Module ActiveDirectory
    $date = [DateTime]::Today.AddDays(-60)
    $pcs = Get-ADComputer -Filter  'PasswordLastSet -le $date'  -properties PasswordLastSet
    foreach ($pc in $pcs) {
    $dn = $pc.DistinguishedName
    $ldPath = "AD:\",$dn -join ""
    if ((Get-ChildItem $ldPath | where {$_.objectClass -eq "msFVE-RecoveryInformation"}) -eq $null) {echo $pc.name}} 
    
    2 people found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. MTG 1,241 Reputation points
    2022-05-30T10:00:28.167+00:00

    Be aware that having "some" recovery key does not always help. It needs to fit the current partitions that you want to secure, so your approach is not securely leading to the desired result as keys can be outdated or some partitions might not have their key backuped while others have.

    What you should do instead: deploy a script (as immediate scheduled task) that runs on all machines that adbackup all keys of all drives presently connected.

    0 comments No comments

  2. BCR 41 Reputation points
    2022-05-30T10:13:21.96+00:00

    Hi. Thanks for your reply. Agree.
    But for phase1 we would like to collect AD joined machines which don't have recovery key so we can start to investigate what's the reason that key isn't stored in AD, so we are (still) searching a powershell way for gathering those assets...

    0 comments No comments

  3. Andreas Baumgarten 120.2K Reputation points MVP
    2022-05-30T10:24:39.48+00:00

    Hi @BCR ,

    maybe this helps to get started:

    https://4sysops.com/archives/find-bitlocker-recovery-passwords-in-active-directory-with-powershell/

    The rest will be an easy if/else -> if msFVE-RecoveryPassword is not null = bitlocker recovery exists and else bitlocker recovery does not exist

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  4. BCR 41 Reputation points
    2022-05-31T09:22:08.323+00:00

    Thank you all for your replies and help.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.