Esempio n. 1
0
        void WriteReports(DomainUserInfo manager)
        {
            var repots = GetDirectReports(manager.DistinguishedName);

            if (repots.Count > 0)
            {
                level++;
            }
            foreach (var rep in repots)
            {
                Console.WriteLine("{0}\t{1}", rep, level);
            }
            foreach (var rep in repots)
            {
                WriteReports(rep);
            }
        }
Esempio n. 2
0
        private DomainUserInfo GetDomainUser(DirectoryEntry entity)
        {
            DomainUserInfo user = new DomainUserInfo();

            user.ADAccount          = GetPropertieValue(entity, "sAMAccountName");
            user.FirstName          = GetPropertieValue(entity, "givenName");
            user.LastName           = GetPropertieValue(entity, "sn");
            user.MobilePhone        = GetPropertieValue(entity, "mobile");
            user.JobTitle           = GetPropertieValue(entity, "title");
            user.Office             = GetPropertieValue(entity, "physicalDeliveryOfficeName");
            user.DistinguishedName  = GetPropertieValue(entity, "distinguishedName");
            user.ManagerDescription = GetPropertieValue(entity, "manager");
            var eid = GetPropertieValue(entity, "employeeID");

            user.EmployeeID = System.Text.RegularExpressions.Regex.Replace(eid, "\\D", "");
            user.Email      = GetPropertieValue(entity, "mail");

            return(user);
        }