/// <summary>
        /// Gets the GAL for the system
        /// </summary>
        /// <param name="UserName">User name using</param>
        /// <param name="Password">Password using</param>
        /// <param name="Server">Server Name</param>
        /// <returns>a StringDictionary containing the name
        /// and email address of everyone in the GAL</returns>
        public static StringDictionary GetGAL(string UserName, string Password, string Server)
        {
            StringDictionary  ReturnArray = new StringDictionary();
            List <LDAP.Entry> Entries     = null;

            using (LDAP.Directory TempDirectory = new Utilities.LDAP.Directory("", UserName, Password, Server))
            {
                Entries = TempDirectory.FindActiveUsersAndGroups("mail=*");
                TempDirectory.Close();
            }
            foreach (LDAP.Entry Entry in Entries)
            {
                ReturnArray.Add(Entry.Name, Entry.Email);
            }
            return(ReturnArray);
        }
Beispiel #2
0
 /// <summary>
 /// Gets the GAL for the system
 /// </summary>
 /// <param name="UserName">User name using</param>
 /// <param name="Password">Password using</param>
 /// <param name="Server">Server Name</param>
 /// <returns>a StringDictionary containing the name
 /// and email address of everyone in the GAL</returns>
 public static StringDictionary GetGAL(string UserName, string Password, string Server)
 {
     StringDictionary ReturnArray = new StringDictionary();
     List<LDAP.Entry> Entries = null;
     using (LDAP.Directory TempDirectory = new Utilities.LDAP.Directory("", UserName, Password, Server))
     {
         Entries = TempDirectory.FindActiveUsersAndGroups("mail=*");
         TempDirectory.Close();
     }
     foreach (LDAP.Entry Entry in Entries)
     {
         ReturnArray.Add(Entry.Name, Entry.Email);
     }
     return ReturnArray;
 }