title: Accessing Bitlocker Recovery information from Active Directory
body: <p>So I am trying to access bitlocker recovery information from AD using C#. I've checked out these links:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/10075310/how-to-access-bitlocker-recovery-tab-programmatically-to-backup-recovery-passwor">How to access bitlocker recovery tab programmatically to backup recovery passwords</a></p></li>
  <li><p><a href="http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/70803ee5-bb6b-4b27-a23a-51b4a77805fb/" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/70803ee5-bb6b-4b27-a23a-51b4a77805fb/</a></p></li>
  </ul>
  
  <p>And they both suggest (ultimately) an implementationlike this:</p>
  
  <pre><code> public String GetBitlockerKey(string compName)
      {
          string bitlockerPassword = string.Empty;
          DirectoryEntry deEntry = new DirectoryEntry(_path);
          DirectorySearcher searcher = new DirectorySearcher(_path);
          searcher.SearchScope = SearchScope.Subtree;
          searcher.ReferralChasing = ReferralChasingOption.All;
  
          try
          {
              searcher.Filter = String.Format("(&amp;(objectCategory=Computer)(cn={0}))", compName);
              SearchResult result = searcher.FindOne();
              object recoveryInformation = result.GetDirectoryEntry().Properties["msFVE-RecoveryInformation"].Value;
  
              if (recoveryInformation != null)
              {
                // Do stuff with recovery information...
              }
              else
              {
                  bitlockerPassword = "Failed to find the computer object.";
              }
          }
          catch (Exception e)
          {
              // handle execptions
              return e.Message;
          }
          return bitlockerPassword;
      }
  </code></pre>
  
  <p>...but that property doesn't exist- the "msFVE-RecoveryInformation" property. Am I thinking about this wrong? I don't think it's a permissions issue, because I can access the bitlocker keys through AD. Any idea what I'm doing wrong? </p>