Esempio n. 1
0
 public static DirectoryEntry GetRootDirectoryEntry(int ldapPort)
 {
     return(new DirectoryEntry
     {
         Path = AdsUtils.GetRootPath(ldapPort)
     });
 }
Esempio n. 2
0
 private static void SetAcls(AdamServiceSettings adamServiceSettings)
 {
     ManageAdamService.RunDsAcls(adamServiceSettings, "OU=MSExchangeGateway");
     using (DirectoryEntry rootDirectoryEntry = AdsUtils.GetRootDirectoryEntry(adamServiceSettings.LdapPort))
     {
         string text = (string)rootDirectoryEntry.Properties["ConfigurationNamingContext"].Value;
         ManageAdamService.RunDsAcls(adamServiceSettings, text);
         string subTreeDn = "CN=Deleted Objects," + text;
         ManageAdamService.RunDsAcls(adamServiceSettings, subTreeDn);
         ManageAdamService.SetAdministrator(adamServiceSettings, text);
     }
 }
Esempio n. 3
0
        public static bool GetAdsServiceExists(int ldapPort)
        {
            bool result = false;

            try
            {
                result = DirectoryEntry.Exists(AdsUtils.GetRootPath(ldapPort));
            }
            catch (COMException ex)
            {
                if (-2147016646 == ex.ErrorCode)
                {
                    return(false);
                }
                throw;
            }
            return(result);
        }