Exemple #1
0
 public void Import(string ldapPath, ContainerInfo destinationContainer)
 {
     try
     {
         var deserializer        = new ActiveDirectoryDeserializer(ldapPath);
         var connectionTreeModel = deserializer.Deserialize();
         var importedRootNode    = connectionTreeModel.RootNodes.First();
         if (importedRootNode == null)
         {
             return;
         }
         var childrenToAdd = importedRootNode.Children.ToArray();
         destinationContainer.AddChildRange(childrenToAdd);
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex, logOnly: true);
     }
 }
 public static void Import(string ldapPath, ContainerInfo destinationContainer, bool importSubOu)
 {
     try
     {
         ldapPath.ThrowIfNullOrEmpty(nameof(ldapPath));
         var deserializer        = new ActiveDirectoryDeserializer(ldapPath, importSubOu);
         var connectionTreeModel = deserializer.Deserialize();
         var importedRootNode    = connectionTreeModel.RootNodes.First();
         if (importedRootNode == null)
         {
             return;
         }
         var childrenToAdd = importedRootNode.Children.ToArray();
         destinationContainer.AddChildRange(childrenToAdd);
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex);
     }
 }