C# Bitlocker pass recovery
hej Alle Sammen.jeg sidder og arbejder på at få trukket bitlocker password ud af AD.
til et tool jeg udvikler. men har brugt hele dagen i går på at finde artikler ang dette og alle jeg har fundet på goggle. har jeg ikke kunnet få til at virke. er der nogen her der kan hjælpe. min kode ser foreløbig sådan her ud
public string GetBitlockerKey(string Assetid,string Domain)
{
string bitlockerPassword = string.Empty;
DirectoryEntry deEntry = new DirectoryEntry(Domain);
DirectorySearcher searcher = new DirectorySearcher(deEntry);
searcher.SearchScope = SearchScope.Subtree;
searcher.ReferralChasing = ReferralChasingOption.All;
try
{
searcher.Filter = String.Format("(&(objectCategory=computer)(cn={0}))", Assetid);
SearchResult result = searcher.FindOne();
object recoveryInformation = result.GetDirectoryEntry().Properties["msFVE-RecoveryInformation"].Value;
if (recoveryInformation != null)
{
bitlockerPassword = recoveryInformation.ToString();
}
else
{
bitlockerPassword = "Failed to find the computer object.";
}
}
catch (Exception e)
{
// handle execptions
return e.Message;
}
return bitlockerPassword;
}