Hi,
We have set up the following script as a custom command, and run it against Computer Objects in Adaxes:
import-module adaxes
#Searches AD for the specified computer
$computer = get-admcomputer %cn%
#Saves computer distinguishedname for future use
$comp_dn = $computer.distinguishedname
#Fetches bitlocker ad object located below the computer object
try
{
$recovery_info = get-admobject -filter 'Objectclass -eq "msFVE-RecoveryInformation"' -searchbase $comp_dn -properties msfve-recoverypassword
}
catch
{
$Context.Cancel("Unable to retrieve recovery key for %cn%!")
}
#If recovery key is present, print out to web interface, if not print error message
if ($recovery_info."msFVE-RecoveryPassword")
{
$context.LogMessage("Computer name: %cn%", "Warning")
$context.LogMessage("Bitlocker Recovery Key: $($recovery_info."msFVE-RecoveryPassword")", "Warning")
}
elseif (!($recovery_key))
{
$Context.Cancel("Unable to retrieve recovery key for %cn%!")
}
Output looks something like this: