{"id":1732,"date":"2025-11-09T23:42:59","date_gmt":"2025-11-09T23:42:59","guid":{"rendered":"https:\/\/www.ultrexstaff.com\/?p=1732"},"modified":"2025-11-09T23:43:00","modified_gmt":"2025-11-09T23:43:00","slug":"powershell-script-to-collect-bitlocker-recovery-key","status":"publish","type":"post","link":"https:\/\/www.ultrexstaff.com\/?p=1732","title":{"rendered":"Powershell Script to Collect Bitlocker Recovery Key"},"content":{"rendered":"\n<p><strong>Create this powershell script:<\/strong><\/p>\n\n\n\n<p># Ensure the BitLocker module is imported<\/p>\n\n\n\n<p>Import-Module BitLocker<\/p>\n\n\n\n<p># Retrieve all BitLocker volumes<\/p>\n\n\n\n<p>$bitLockerVolumes = Get-BitLockerVolume<\/p>\n\n\n\n<p># Iterate through each BitLocker-protected volume<\/p>\n\n\n\n<p>foreach ($volume in $bitLockerVolumes) {<\/p>\n\n\n\n<p>&nbsp; &nbsp; $mountPoint = $volume.MountPoint<\/p>\n\n\n\n<p>&nbsp; &nbsp; $keyProtector = $volume.KeyProtector | Where-Object { $_.KeyProtectorType -eq &#8216;RecoveryPassword&#8217; }<\/p>\n\n\n\n<p>&nbsp; &nbsp; $recoveryPassword = $keyProtector.RecoveryPassword<\/p>\n\n\n\n<p>&nbsp; &nbsp; if ($recoveryPassword) {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; Write-Output &#8220;Drive $mountPoint &#8211; Recovery Password: $recoveryPassword&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; } else {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; Write-Output &#8220;Drive $mountPoint does not have a recovery password protector.&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; }<\/p>\n\n\n\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create this powershell script: # Ensure the BitLocker module is imported Import-Module BitLocker # Retrieve all BitLocker volumes $bitLockerVolumes = Get-BitLockerVolume # Iterate through each BitLocker-protected volume foreach ($volume in $bitLockerVolumes) { &nbsp; &nbsp; $mountPoint = $volume.MountPoint &nbsp; &nbsp; $keyProtector = $volume.KeyProtector | Where-Object { $_.KeyProtectorType -eq &#8216;RecoveryPassword&#8217; } &nbsp; &nbsp; $recoveryPassword = $keyProtector.RecoveryPassword &nbsp; [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124,98,113,120],"tags":[],"class_list":["post-1732","post","type-post","status-publish","format-standard","hentry","category-command-line","category-it-knowledge-base-articles","category-servers","category-windows","post-preview"],"_links":{"self":[{"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/1732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1732"}],"version-history":[{"count":1,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/1732\/revisions"}],"predecessor-version":[{"id":1733,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/1732\/revisions\/1733"}],"wp:attachment":[{"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ultrexstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}