OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Retrieving Bitlocker Recovery Keys from AD

  • Thread starter Thread starter A. To
  • Start date Start date
A

A. To

Guest
Fairly new to Powershell, I managed to get the following code to retrieve the Bitlocker key for computers in the domain, however, I have an issue with it:

Code:
Clear-Host
$TestOU = "OU=ABC,DC=XYZ,DC=com"
$PCs = Get-ADComputer -Filter * -SearchBase $TestOU
$Results = ForEach ($Computer in $PCs)
{
New-Object PSObject -Property @{
ComputerName = $Computer.Name
RecoveryPassword = Get-ADObject -Filter 'objectclass -eq "msFVE- 
RecoveryInformation"' -SearchBase $computer.DistinguishedName -Properties 
msFVE-RecoveryPassword,whencreated | sort whencreated -Descending | select 
msfve-recoverypassword
}
}
$Results

My output for each password begins with {a{msfve-recoverypassword= and I'm not sure how to remove this.
<p>Fairly new to Powershell, I managed to get the following code to retrieve the Bitlocker key for computers in the domain, however, I have an issue with it:</p>

<pre><code>Clear-Host
$TestOU = "OU=ABC,DC=XYZ,DC=com"
$PCs = Get-ADComputer -Filter * -SearchBase $TestOU
$Results = ForEach ($Computer in $PCs)
{
New-Object PSObject -Property @{
ComputerName = $Computer.Name
RecoveryPassword = Get-ADObject -Filter 'objectclass -eq "msFVE-
RecoveryInformation"' -SearchBase $computer.DistinguishedName -Properties
msFVE-RecoveryPassword,whencreated | sort whencreated -Descending | select
msfve-recoverypassword
}
}
$Results
</code></pre>

<p>My output for each password begins with {a{msfve-recoverypassword= and I'm not sure how to remove this.</p>
Continue reading...
 

Latest posts

A
Replies
0
Views
1
Alfredo Augusto Petri
A
Top